• AtoZ67 (2/6/2015)


    Converting a database from Access 2007 to SQL Server 2014.

    When I run a query it takes about 25mins in SQL Server while Access takes about couple of mins.

    When converted to a OpenQuery, it takes about 10mins which is good but its still taking more time than Access.

    Below is the query:

    Select a.*

    INTO ##Temptble

    From OpenQuery (JDDWH,'Select * From CK500.DDTA.K111 WHERE IABCDJ>113001 And IABCT=''AS'' Or ILDCT=''CD''') As a;

    This particular Linked Server is AS400 but also have other linked servers which are SQL Server and queries slow there as well.

    How can I make SQL queries run faster when pulling data from Linked Servers?

    Is the same amount of data being returned by the Access and the Linked Server queries?

    There might be some operator-precedence gremlins caused by the unbracketed mixed Boolean operators in the WHERE clause.

    Just a thought.