首先要保证服务器开启了 Ad Hoc Distributed Queries
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
insert into 表名 select *
from OPENROWSET('SQLOLEDB',
'SERVER=192.168.1.101;uid=数据库用户名;pwd=数据库密码;Database=数据库名称,'select * from 表名') as a
本文介绍如何在SQL Server中启用AdHocDistributedQueries设置,并通过OPENROWSET实现跨服务器的数据复制。具体步骤包括使用sp_configure命令启用配置选项,以及通过INSERT...SELECT语句结合OPENROWSET从远程服务器检索数据。
1863

被折叠的 条评论
为什么被折叠?



