MarketingDrive
asked on
Copy SQL Table from 1 database to another
I added another database to my SQL 2005 server and need to copy some table from the old database, what is the easiest method to do so. By the way, I use MS SQL Server management Studio to manage the tavles, views etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or
insert into db2..table1
select * from db1..table1 where db1..table1.id>50
insert into db2..table1
select * from db1..table1 where db1..table1.id>50
Right-Click on the source database in SQL Management Studio and choose 'Tasks' and then Export Data. This will bring up a wizard that will guide you..
Hi MarketingDrive,
I did the following to copy an existing table in our production db to our test db (on the same sql server, but in different databases):
In your Microsoft SQL server Management Studio, open a 'new query' window.
Past following in the window and edit the names between [ ]
USE [targetDBname];SELECT * INTO [targetTable] FROM [sourceDB].dbo.[sourceTabl e]
Hope this helps you.
I did the following to copy an existing table in our production db to our test db (on the same sql server, but in different databases):
In your Microsoft SQL server Management Studio, open a 'new query' window.
Past following in the window and edit the names between [ ]
USE [targetDBname];SELECT * INTO [targetTable] FROM [sourceDB].dbo.[sourceTabl
Hope this helps you.
select * into db2..table1 from db1..table1 where db1..table1.id>50