如何将数据从一个表插入另一个数据库的另一表中 [英] How to insert data from one table into another table in other database

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

问题描述

您好,

我可以告诉我如何从中插入数据.例如,两个表中的Database1列中的table1和Database2中的table2都是相同的table1包含一个标志,当将数据插入到database2的table2中时,该标志将更新为1.
有人可以告诉我该怎么做吗?

Hi ,

My can someone tell me how to insert data from For example There is a table1 in a Database1 and table2 in Database2 columns in both the tables are same table1 have a flag which will be updated as 1 when the data is inserted in table2 in database2.
can anyone tell me how to do this?

推荐答案

这个例子,您必须在括号之间添加除Identity Column
之外的所有列.
this an example you have to add all columns between Brackets except Identity Column

insert into Database1.dbo.Table1
select (AllCOl except identity Col)  from Database2.dbo.Table2


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

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