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
 copying one table to another database

Author  Topic 

BendJoe
Posting Yak Master

128 Posts

Posted - 2007-11-15 : 13:52:02
How can I copy a table from one db to another? Is there copy paste method.

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2007-11-15 : 13:54:29
easiest way is to use the import/export wizard

Em
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-15 : 22:20:56
Or use select ... into table_name from ... where ...
Go to Top of Page

kiruthika
Yak Posting Veteran

67 Posts

Posted - 2007-11-15 : 23:58:34
Hai!
within sql or another database?
within sql you can use

select * into master.dbo.example from sample.dbo.example
This querey creates a new table named example on the master
database from sample database

Happy programming!
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2007-11-16 : 04:04:40
If you are using sql 2005 , and depending on the size of the data , you can copy and paste. Although , I would go for the Import/Export data method

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-17 : 00:57:33
>> select * into master.dbo.example from sample.dbo.example

Should never mess up master db.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-23 : 01:39:14
quote:
Originally posted by kiruthika

Hai!
within sql or another database?
within sql you can use

select * into master.dbo.example from sample.dbo.example
This querey creates a new table named example on the master
database from sample database

Happy programming!



Also note that the target table wont have any indices that source table has

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -