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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 DB issue in SQL server management studio

Author  Topic 

n4nature
Starting Member

7 Posts

Posted - 2012-10-03 : 16:49:35
I am trying to extract a part of data into a temp table on a different database on a separate SQL server. Here's the query for that:


SELECT [DB1].[dbo].T1 .Col1, [DB1].[dbo].T2 .Col1, [DB1].[dbo].T1 .Col2, [DB1].[dbo].T2.Col2
INTO [DB2].dbo.DB2
FROM [DB1].[dbo].T1


It's not recognizing DB2 here. When I run this query under SQL Server Management Studio, it gives an error:

Database 'DB2' does not exist.

If I comment out the line2 in above query, it compiles and works fine.

Any idea on how to fix this problem?

chadmat
The Chadinator

1974 Posts

Posted - 2012-10-03 : 16:53:04
Duplicate

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=179456
Go to Top of Page
   

- Advertisement -