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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to move a table to another database

Author  Topic 

dbonneau
Yak Posting Veteran

50 Posts

Posted - 2009-04-14 : 14:45:25
Hi,
I queried a data from table XXX in database AA using below logic and made a new table called "temp".
What I would like to do is to output the temp table to different database called "BB"
Could you tell me how to do that ?

Thanks !

use AA
select x,y,z
into temp
from dbo.XXX
where date = '04/05/2009'

shawnafisher
Starting Member

5 Posts

Posted - 2009-04-14 : 14:49:32
Run this on BB database, providing they are on the same Server.
select x,y,z
into temp
from AA.dbo.XXX
where date = '04/05/2009'
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-04-14 : 15:16:43
use DTS if they are on different servers.
Go to Top of Page
   

- Advertisement -