| Author |
Topic |
|
jfm
Posting Yak Master
145 Posts |
Posted - 2012-05-14 : 09:28:33
|
| Hi Im trying to create a new_table from an existing_table in an other database2. I did the query: SELECT * INTO database1.new_tableFROM database2.existing_tableAnd i woked, last week. Today im trying to do the same and I have the following message: msg 2760, level 16, state 1, line 1Any ideas? Thanks |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-05-14 : 09:36:05
|
| It means that one of the schemas database1 or database2 is not available in the current databaseMadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-05-14 : 09:37:16
|
The syntax is not correct. You are missing a schema, or SQL Server treats "database1" and "database2" as the schema names.And since the schema name is not correct, you get this error message. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
jfm
Posting Yak Master
145 Posts |
Posted - 2012-05-14 : 09:39:56
|
| So, What im supposed to do? Because, as far as I know, I didn't make any changes in my database. Whats the solution in this case? Thanks |
 |
|
|
jfm
Posting Yak Master
145 Posts |
Posted - 2012-05-14 : 09:41:03
|
| I know, Its supposed to be my destination database the one SQL is not recognizing. What can I do?thanks |
 |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-14 : 10:23:06
|
| [code]use thisSELECT *INTO database1..new_tableFROM database2..existing_table[/code]Vijay is here to learn something from you guys. |
 |
|
|
jfm
Posting Yak Master
145 Posts |
Posted - 2012-05-14 : 11:00:55
|
It worked that way: CREATE TABLE Destination_database..New_TableFROM Existing_database.Info_TableI dont understand, why using (..) in my destination file worked, and just using (.) in the existing one. Thanks for your help!!quote: Originally posted by vijays3
use thisSELECT *INTO database1..new_tableFROM database2..existing_table Vijay is here to learn something from you guys.
|
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-05-14 : 11:27:28
|
.. Means that you are using the default schema, which in most cases are dbo.What you reallt wrote wasCREATE TABLE Destination_database.dbo.New_TableFROM Existing_database.dbo.Info_Table N 56°04'39.26"E 12°55'05.63" |
 |
|
|
jfm
Posting Yak Master
145 Posts |
Posted - 2012-05-14 : 11:46:36
|
Perfect!! Thank you very muchquote: Originally posted by SwePeso .. Means that you are using the default schema, which in most cases are dbo.What you reallt wrote wasCREATE TABLE Destination_database.dbo.New_TableFROM Existing_database.dbo.Info_Table N 56°04'39.26"E 12°55'05.63"
|
 |
|
|
|