Solved

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

Posted on 2009-05-04
4
390 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 250 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 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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