SQL数据库,如何把服务器中的一张表插入到另外一个服务器的一张表中

2023-05-13,,

先开启

exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

然后调用

INSERT INTO SoyErpBasicData.dbo.Base_Datadictionary ( Type ,
Code ,
Name ,
SeqNO ,
State ,
Notes ,
ParentID ,
IsLeaf_YN ,
CompCode
)
SELECT Type ,
Code ,
Name ,
SeqNO ,
State ,
Notes ,
ParentID ,
IsLeaf_YN ,
CompCode

FROM openrowset('SQLOLEDB','192.168.0.188';'sa';'hualong2012',SoyErpBasicData.dbo.Base_Datadictionary)

WHERE id IN (268,269)

调用完后关闭

exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure

总结:很简单的,三部曲

SQL数据库,如何把服务器中的一张表插入另外一个服务器的一张表中的相关教程结束。

《SQL数据库,如何把服务器中的一张表插入到另外一个服务器的一张表中.doc》

下载本文的Word格式文档,以方便收藏与打印。