dbTalk Databases Forums  

Select Into across Linked Servers

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Select Into across Linked Servers in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jennifer
 
Posts: n/a

Default Select Into across Linked Servers - 09-27-2007 , 10:38 AM






Hi. I'm trying to copy from one table to another across 2 different
servers with the following:

select *
into #Tmp_Hdr
from parsaleshdr
where businessday = '9/20/07'

select *
into [pdsqla01\pdsqla01].impact_exec.dbo.parsaleshdr
from #Tmp_Hdr

This gives me an error:
The object name 'pdsqla01\pdsqla01.impact_exec.dbo.' contains more
than the maximum number of prefixes. The maximum is 2.

Not really sure how to get around it. I was trying to use OpenQuery,
but that's really for selecting from, not into. How can I get around
this?

Thanks,
Jennifer


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Select Into across Linked Servers - 09-28-2007 , 04:43 PM






Jennifer (J.Evans.1970 (AT) gmail (DOT) com) writes:
Quote:
Hi. I'm trying to copy from one table to another across 2 different
servers with the following:

select *
into #Tmp_Hdr
from parsaleshdr
where businessday = '9/20/07'

select *
into [pdsqla01\pdsqla01].impact_exec.dbo.parsaleshdr
from #Tmp_Hdr

This gives me an error:
The object name 'pdsqla01\pdsqla01.impact_exec.dbo.' contains more
than the maximum number of prefixes. The maximum is 2.

Not really sure how to get around it. I was trying to use OpenQuery,
but that's really for selecting from, not into. How can I get around
this?
You need to create the table on the remote server in advance.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.