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
 SQL Server Administration (2005)
 question about table copy?

Author  Topic 

mapperkids
Yak Posting Veteran

50 Posts

Posted - 2007-03-15 : 20:54:15

Hi,

Here is my question:

DbA and DbB are the same, but I added a new table in DbB for testing purpose, now I want to have the new table in dbA as well.

Is there any way to copy the table in dbB to dbA instead of create the table in DbA from scratch?

Thanks!



khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-15 : 21:31:02
You can script out the table from dbB and run the script in dbA. This will create the structure.
Then to copy the data over

insert into dbA.dbo.newtable(col1, col2 ...)
select col1, col2, . . .
from dbB.dbo.newtable



KH

Go to Top of Page
   

- Advertisement -