all groups > sql server (alternate) > october 2005 >
You're in the

sql server (alternate)

group:

Temp Table on Linked Server


Temp Table on Linked Server Ootyguy
10/7/2005 12:58:22 PM
sql server (alternate):
Trying to do this all day and googling for answers but found none, hope
someone can help. Thanks in advance.

select * into
OPENROWSET('SQLOLEDB','SERVER';'uid';'pwd',##test)
from LocalTable

Reason: I am joining local tables with linked server tables using the
format "LinkedServer.database.owner.object" to execute a query, it
takes forever to execute since the tables joined on the remote servers
have more than 50Mil records. I read somewhere that sql server needs to
copy the tables locally to the temp db and does the join there, hence I
was hoping to dump the data of the local database into a temp table on
the remote server and then do a join with OPENQUERY, which will execute
the query on the linked server and return the results.
Re: Temp Table on Linked Server ROAN
10/7/2005 2:46:59 PM

Ootyguy napisal(a):
[quoted text, click to view]


Using OPENROWSET for big tabels is not good idea, so you have right
trying copy this table.
To copy this tabel you can use for example DTS. It will take you couple
minutes and you'll have what you want.
Re: Temp Table on Linked Server Andrew J. Kelly
10/7/2005 4:05:01 PM
If the table is smaller on the local server then why not create a sp on the
remote one that joins these two tables and call the sp remotely?

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

AddThis Social Bookmark Button