sqlserver跨IP 跨库查询 用视图查询

create View view_game_record_detail as ( select * from opendatasource('SQLOLEDB','Data Source=120.78.84.131;User ID = sa;Password=141242').Game_Main.dbo.liugame_record_detail as t1)

删除视图 drop view 视图名字

视图功能需要开启’Ad Hoc Distributed Queries’
用执行下面命令开启:

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

猜你喜欢

转载自blog.csdn.net/qq_38083665/article/details/80720126