|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL SELECT INTO ... IN external_database - syntax errorI am trying to execute the following sql query on SQL Server 2000:
select * INTO "11111111_Poll 137_Archive" IN DB_91163_rwArchive from "11111111_Poll 137" And I receive the follwing error: Incorrect syntax near the keyword 'IN'. DB_91163_Archive is the name of an external database (on the same server), 11111111_Poll 137 is the name of a table in the current databse, and 11111111_Poll 137_Archive is the name of a table (to be created) in the external db (double quotes used because of the space in the table name). What am I doing wrong? Thanks in advance. Are you looking for something like this:
SELECT * INTO "11111111_Poll 137_Archive" FROM DB_91163_rwArchive.dbo."11111111_Poll 137" You need to specify a three-part name to specify a database different from the one you are currently in. <ryan_wil***@hotmail.com> wrote in message Show quoteHide quote news:1149790664.752303.234330@u72g2000cwu.googlegroups.com... >I am trying to execute the following sql query on SQL Server 2000: > > select * INTO "11111111_Poll 137_Archive" IN DB_91163_rwArchive from > "11111111_Poll 137" > > And I receive the follwing error: > Incorrect syntax near the keyword 'IN'. > > DB_91163_Archive is the name of an external database (on the same > server), 11111111_Poll 137 is the name of a table in the current > databse, and 11111111_Poll 137_Archive is the name of a table (to be > created) in the external db (double quotes used because of the space in > the table name). What am I doing wrong? > > Thanks in advance. > Wow thanks for the ridiculously fast reply Mike, its exactly what I
needed. Mike C# wrote: Show quoteHide quote > Are you looking for something like this: > > SELECT * > INTO "11111111_Poll 137_Archive" > FROM DB_91163_rwArchive.dbo."11111111_Poll 137" > > You need to specify a three-part name to specify a database different from > the one you are currently in.
Other interesting topics
Default constraints in SQL Server 2000
Bring back Query Analyser HOW "TOP" is interpreted?? Using FileCopy to Copy Files via T-SQL Simple distributed transaction example does not work Calculated columns... How to generate a table script in T-SQL? log shipping How to Move Sql2000 DTS into Sql2005 legacy folder How to generate reports !!! some basic question |
|||||||||||||||||||||||