exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
create view TestView
as
select * from openrowset('sqloledb','协议:IP或者Host,端口';'用户名';'密码',[DB Name].[Scheme Name].[Table Name])
例如:
openrowset('sqloledb','tcp:192.168.1.3,1433';'sa';'123456',[DB].[dbo].[DataTable])