sql - Fastest Data Transferring Over A Linked Server -


when comes transferring data between linked servers, there have been several method have used in work date.

i'm wondering if there accepted fastest/most efficient way task should handled? or there different situations when 1 should used on another?

i have used:

openquery

insert table (col1, col2, col3) select col1, col2, col3 openquery([server]...... 

openrowset

insert table (col1, col2, col3) select col1, col2, col3 openrowset('sqloledb', 'server=[server]....... 

temptable / sp

insert #temp exec [server].[db].[dbo].[storedprocedure] @param1, @param2 

after 'googling' haven't got definitive answer... or there option?

the important bit ensure remote query executed remotely.

this will happen temp table/sp route.

for other 2 options, may pull data locally before sorting/filtering etc. whether depends on linked server settings. have other faults too

  • you can't control linked server settings openrowset because adhoc
  • openquery , openrowset not allow parameters: string constants

so, option 3 best route

for more, see


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -