Click here to Skip to main content
15,924,583 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
I ve Two DBs named Contacts And Master_Contacts.In Contacts DB I ve 5 tables with data.
i want to copy these all tables with data(from Contacts DB) to Master_Contacts DB.

Regarding any answers reply me.


Regards,
MURUGESAN.P
Posted

For transferring from one server to another server then you have to use LinkedServer and transfer the data.

use this System SP to add Linked server: sp_addlinkedserver


IF you are transferring within databse then use simple select into clause statement with database name.
 
Share this answer
 
v3
You can use Sql Query

SQL
Select * into destinationdb.dbo.tablename from sourcedbname.dbo.tablename


Suppose table "Details" is in databse1 and we want to copy this table to database2 then

SQL
Select * into databse2.dbo.Tablename from databse1.dbo.Details



here db2.dbo.Tablename
Tablename u can give any name according to ur need.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900