Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shah_tech02
Starting Member
2 Posts |
Posted - 2008-07-16 : 05:24:59
|
| Hi All,I need to create the SQL table in a different server using given SQL query. I'm using the following statements but its giving error:Select * into X.Y.dbo.table1from select * from table2 aaError is as follows:The object name 'X.Y.dbo.' contains more than the maximum number of prefixes. The maximum is 2.From a different server I'm trying to create the table in server X, database Y.Any ideas? Thanks in advanceShahtech |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-07-16 : 05:47:10
|
| Hello,it looks like you have not created a linked server.Select * into [myLinkedServer].[myDatabase].dbo.table1from table2GreetingsWebfredThere are 10 types of people in the world: Those who understand binary, and those who don't... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-16 : 06:36:47
|
| or use OPENROWSET |
 |
|
|
shah_tech02
Starting Member
2 Posts |
Posted - 2008-07-16 : 06:58:23
|
| created linked server, but still not working any more ideas?Shahtech |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-07-16 : 10:01:45
|
| can you explain please - still not working is not very helpful.GreetingsWebfredThere are 10 types of people in the world: Those who understand binary, and those who don't... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-16 : 10:06:34
|
something likeSELECT a.* INTO Y.dbo.table1FROM OPENROWSET('SQLNCLI', 'Server=yourotherservername;Trusted_Connection=yes;', 'SELECT* FROM YourTable') AS a; |
 |
|
|
|
|
|