【总结】跨服务器操做数据库

update TaskServer.dbo.TaoBaoItemInfoes set TradeCount30 =(select SOLD_QUANTITY_30 from openrowset( 'SQLOLEDB ', '192.168.1.3'; 'root'; 'jeqee1!',TAOBAO_QA.dbo.TB_ITM_INFO) a where TaskServer.dbo.TaoBaoItemInfoes.Id=a.num_iid)sql

 

若是遇到错误安全

 

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问,由于此组件已做为此服务器安全配置的一部分而被关闭。系统管理员能够经过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。服务器

 

则执行以下两条语句开启Ad Hoc Distributed Queries组件:编辑器

exec sp_configure 'show advanced options',1
reconfigureio

exec sp_configure 'Ad Hoc Distributed Queries',1
reconfiguredva

 

执行完成以后若是须要关闭Ad Hoc Distributed Queries组件,在sql查询编辑器中执行以下语句:配置

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

相关文章
相关标签/搜索