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
 General SQL Server Forums
 New to SQL Server Programming
 TABLE INTO DATABASE

Author  Topic 

jfm
Posting Yak Master

145 Posts

Posted - 2012-05-30 : 10:38:39
Hi there,

I have 2 tables in one database and I want to copy them into another database.

Which is the query?

Thanks

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2012-05-30 : 11:04:12
www.sqlteam.com/forums/topic.asp?TOPIC_ID=170858









How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-30 : 15:44:38
quote:
Originally posted by jfm

Hi there,

I have 2 tables in one database and I want to copy them into another database.

Which is the query?

Thanks


multiple ways

1. Export Import wizard
2. Linked server
3. OPENROWSET

if you want to preserve constraints, indexes etc also script the tables out and run it in new database using generate scripts wizard

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -