September 17, 2009 at 1:01 am
Hi,
I have to copy a table from server1 to server2.
created the SP where table frm server1 should be copied to server2 (linked server in server1)
have tried the following query but it showing following msg..
Select * into "server2".dbname.dbo.tablename from tablename
"The object contains more than the maximum number of prefixes. The maximum is 2."
Note :
The entire process should be performed in server1.
Pls help how to perform the above process.
Thanks..Gugan
September 17, 2009 at 1:25 am
gugan_ta (9/17/2009)
Hi,I have to copy a table from server1 to server2.
created the SP where table frm server1 should be copied to server2 (linked server in server1)
have tried the following query but it showing following msg..
Select * into "server2".dbname.dbo.tablename from tablename
"The object contains more than the maximum number of prefixes. The maximum is 2."
Note :
The entire process should be performed in server1.
Pls help how to perform the above process.
Thanks..Gugan
Select * into "server2".dbname.dbo.tablename from tablename
Just remove the double quotes around server2. This query will insert data into tablename stored on server2 from current server.
September 17, 2009 at 4:42 am
Hi,
It gives the same error...
Pls provide alternate..?
Gugan
September 17, 2009 at 5:18 am
gugan_ta (9/17/2009)
Hi,It gives the same error...
Pls provide alternate..?
Gugan
can u post the error message?
The other way is to:
1. create a linked server on server2 pointing to server1. from there insert the data
select * into mytable from server1.dbname.dbo.mytable
2. import the table data
3. bcp out data from source table and then bcp in to target database's table.
4. create ssis package.
September 17, 2009 at 5:19 am
you cannot create a table on the fly across a linked server. the select into...from tries to do that.
you can only insert into tables that exist.
so INSERT INTO "server2".dbname.dbo.TableThatExists
select * from tablename
will work.
the linked server only allows Data Maipulation(DML), and not object creation (DDL)
hope that helps!
Lowell
September 17, 2009 at 5:28 am
Thanks Lowell. That didnt click to me :w00t:
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply