OpenQuery vs OpenRowset Performance

  • I have an environment with several servers in a central location and approx 56 remote servers. We are currently using OPENROWSET for our queries, but I am curious if there are any performance benefits of one vs the other. When I use an OPENQUERY against a linked or an adhoc OPENROWSET, they produce identical execution plans. If I use a four-part name for the same query, it is approximately 10% of the estimated resources.

    Can someone help me understand what's happening here?

    Here are the 3 queries:

    select * from openquery(myserver,'select * from TestDB.dbo.testtable')

    select * from openrowset('SQLOLEDB','Server=myserver;uid=myid;pwd=mypass;',

    'select * from TestDB.dbo.testtable')

    select * from myserver.TestDB.dbo.testtable

  • Here are my inputs.

    OPENQUERY uses existing connected remote server. OPENROWSET uses existing retrieved data (rowset). The first one has more flexibility in retrieving data. The second one discloses your password.

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply