跨机器检索SQL

时间:2014-10-09 阅读:
exec sp_configure 'show advanced options',1 reconfigure exec sp_configure 'Ad Hoc Distributed Queries',1 reconfigure GO SELECT * FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=.\SQL2005;User ID=sa;Password=Aa12345678').[TYUT_IRS2005].[dbo].[cx_ir_school] GO exec sp_configure 'Ad Hoc Distributed Queries',0 reconfigure exec sp_configure 'show advanced options',0 reconfigure

 exec sp_configure 'show advanced options',1

reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
GO
SELECT *
FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=.\SQL2005;User ID=sa;Password=Aa12345678').[TYUT_IRS2005].[dbo].[cx_ir_school]
GO
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure

[责任编辑:jumbot]

[发表评论] [收藏本页]