开发者

Moving data from T1 in Database D1 to T1 in Database D2

开发者 https://www.devze.com 2023-03-18 04:24 出处:网络
I have two databases: D1 and D2. D1 has Table Basic_Details; D2 also has a table Basic_details.Both TheBasic_details tables have the same de开发者_开发问答sign.

I have two databases: D1 and D2.

D1 has Table Basic_Details; D2 also has a table Basic_details. Both The Basic_details tables have the same de开发者_开发问答sign.

D1 has data. So how do I copy all the data from Table in D1 to the Table in D2?


Assuming you are using SQL Server, you should be able to run
INSERT INTO D2.Basic_details SELECT * FROM D1.Basic_details
Note: if you table has identity field, you will need to enable identity inserts.

Update

INSERT INTO D2.dbo.Basic_details SELECT * FROM D1.dbo.Basic_details

or

INSERT INTO D2..Basic_details SELECT * FROM D1..Basic_details

0

精彩评论

暂无评论...
验证码 换一张
取 消