Move Table Form One Database to Another Database in SQL

Resolved SQL
CM
Community Member
November 23, 2015
2 replies
1,442 views
Reviewed by moderators

I have two database database_1 and database_2. I have a table called m_table in database_1 that I want to move to database_2. How can I do this?

2 Answers
Accepted Answer
Verified by Edwin J. Hoffer, Expert · Reviewed November 2015

Try this: n

SELECT * nINTO DestinationDB. MyDestinationTable nFROM SourceDB. MySourceTable 
nnIt will not copy constraints, defaults or indexes. n

Use Generate SQL Server Scripts Wizard to help guide the creation of SQL script's that can: n n• copy the table scheman• any constraints (identity, default values, etc)n• data within the tablen• and many other optionsn