SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 DB issue in SQL server management studio
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

n4nature
Starting Member

7 Posts

Posted - 10/03/2012 :  16:49:35  Show Profile
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

USA
1974 Posts

Posted - 10/03/2012 :  16:53:04  Show Profile  Visit chadmat's Homepage
Duplicate

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=179456

Edited by - chadmat on 10/03/2012 16:53:59
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000