Thursday, January 24, 2019

Improving Performance of ODBC Queries Ran on MS SQL Server

Most queries executed on MS SQL Server on a NetSuite account via ODBC runs relatively slower than when it is ran using generic query tools. This is due to the fact that MSDASQL first translates the queries into a version native to Oracle SQL query before execution.

To improve performance, use OPENQUERY instead so transalation will no longer be necessary for the Microsoft OLEDB provider.

A sample query can be found below:

SELECT TRANSACTION_ID FROM OPENQUERY(NETSUITE, 'SELECT TRANSACTION_ID FROM TRANSACTION_LINES');

You can find further details regarding OPENQUERY in MSDN (http://msdn.microsoft.com/en-us/library/ms188427.aspx)

1 comment: