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)
 Copy Table with Data

Author  Topic 

sunny_10
Yak Posting Veteran

72 Posts

Posted - 2014-11-09 : 01:22:41
Hi

I want to copy table with data from 1 Database to another Database.

Thanks

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2014-11-11 : 15:36:34
use generate script option in SSMS

Javeed Ahmed
https://www.linkedin.com/pub/javeed-ahmed/25/5b/95
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-11 : 16:51:34
or use the import/export wizard
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-11 : 17:26:06
I would use T-SQL to get the table definition and data, and then I'd use the generate script option to get the dependent objects such as indexes, foreign keys, etc.

SELECT * INTO DB2.dbo.Table1 FROM DB1.dbo.Table1

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-12 : 09:16:44
unless you can't link to DB2 from DB1 from some reason. Then SSIS is your friend.
Go to Top of Page
   

- Advertisement -