[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I perform a 'Select Into" on a remote server

Posted on 2009-05-04
4
Medium Priority
?
396 Views
Last Modified: 2012-08-13
I have a remote db within my local studio; configured the linked server...
I can perfrom a select on the remote db by:
select * from [192.xxx.xxx.xxx].testdb.dbo.table

What I would like to do is insert data from a local table into the remote table:

select *
into [192.xxx.xxx.xxx].testdb.dbo.table
from table
0
Comment
Question by:Glen_D
  • 2
4 Comments
 

Author Comment

by:Glen_D
ID: 24299733
forgot to add but here is my error with abover insert code:

contains more than the maximum number of prefixes. The maximum is 2.
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 total points
ID: 24299747
Hello Glen_D,

The new table created with the INTO clause does not support 4 part names. it allows only 2 part names, so you would need to create the table and then use INSERT..SELECT to populate it.

Regards,

Aneesh
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 1000 total points
ID: 24299749
you cannot CREATE a table on a remote server.
but you can insert:
insert into [192.xxx.xxx.xxx].testdb.dbo.table
select *
from table

Open in new window

0
 

Author Closing Comment

by:Glen_D
ID: 31577784
Thanks Gentlemen...really helped out here.  Glen
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question