DAK
DAK

Reputation: 1435

SQL data transfer between two databases on SQL Server 2005

Is there a SQL query I can use to transfer data from a table in one database to a table in another database on a same server?

For example:

UPDATE DB1.Table 
SET 
   DB1.Table.Column1 = DB2.Table.Column1,
   DB1.Table.Column2 = DB2.Table.Column2,
   DB1.Table.Column3 = DB2.Table.Column3;

Upvotes: 0

Views: 1532

Answers (2)

Lav
Lav

Reputation: 1896

You can use DTS (Data Transformation Service) feature of SQL Server 2005.

Here is the good article that explains the process step by step.

Upvotes: 0

ChristopherBrown
ChristopherBrown

Reputation: 152

How about using an insert into statement?

INSERT INTO DB2.Table (Col1, Col2, Col3)
SELECT 
Col1, Col2, Col3
FROM 
 DB1.TABLE

Upvotes: 1

Related Questions