如何将特定表从一个数据库还原到另一个数据库 [英] how to restore particular table from one database to another database

查看:260
本文介绍了如何将特定表从一个数据库还原到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个数据库Database1和database2
这两个数据库有两个表
表1和表2

table1是database1表

table2是database2表


这两个表具有相同的列

我想将Database1 table1更新为database2 table2


任何人都可以帮助我...

I have two database Database1 and database2
and this two database have two tables
table1 and table 2

table1 is database1 table
and
table2 is database2 table


this two tables having same columns

i want to update Database1 table1 to database2 table2


any one help me...

推荐答案

报价:

我想更新从Database1 table1到database2 table2

i want to update Database1 table1 to database2 table2


检查解决方案:
将记录从一个数据库更新到另一个数据库 [


Check Solutions:
Update records from One database to another database[^]


使用"MERGE"是插入/更新数据存在于两个不同的数据库中.

样本:

Using `MERGE` would be an ideal way to insert/update when the data present in two different databases.

Sample:

MERGE INTO Destination_Table AS Dest
USING Source_Table AS Source
ON Dest.ID = Source.ID

WHEN MATCHED THEN 
UPDATE Dest SET Dest.EmpName = Source.Empname,
                Dest.Empdept = Source.Empdept    
WHEN NOT MATCHED THEN 
INSERT VALUES(
                Source.ID
               ,Source.EmpName
               ,Source.Empdept);


这篇关于如何将特定表从一个数据库还原到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆