888 views

Determining if precision errors are causing issues with ODBC queries 

 

Symptoms
  • Queried information lost
  • Precision errors received
  • Error message received during processing
 
Cause
Performing queries on SQL Server 2008 and 2012 may cause precision errors for decimal or number field values using the OPENQUERY syntax with the ODBC driver. 
Resolution
In this case, use the Cast syntax to convert the precision. For example:

SELECT * from OPENQUERY(SERVICENOW, ‘SELECT Cast(sys_mod_count as Decimal(38,0)), number, short_description from incident’) 

Article Information

Last Updated:2015-05-02 09:59:23
Published:2014-06-13