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]