我是靠谱客的博主 幸福小猫咪,这篇文章主要介绍SqlServer通过sql语句访问指定IP地址的数据库1.启用 'Ad Hoc Distributed Queries' 2.查询demo:SELECT * FROM OPENDATASOURCE( 'SQLOLEDB','DataSource=192.168.120.191;User ID=sa;Password=123456').FuelDataMgt.dbo.Operator ,现在分享给大家,希望可以做个参考。

1.启用 'Ad Hoc Distributed Queries'

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

2.查询
demo:SELECT * FROM OPENDATASOURCE
( 
'SQLOLEDB','
DataSource=192.168.120.191;
User ID=sa;
Password=123456'
).FuelDataMgt.dbo.Operator 

3.关闭 'Ad Hoc Distributed Queries'

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


最后

以上就是幸福小猫咪最近收集整理的关于SqlServer通过sql语句访问指定IP地址的数据库1.启用 'Ad Hoc Distributed Queries' 2.查询demo:SELECT * FROM OPENDATASOURCE( 'SQLOLEDB','DataSource=192.168.120.191;User ID=sa;Password=123456').FuelDataMgt.dbo.Operator 的全部内容,更多相关SqlServer通过sql语句访问指定IP地址的数据库1.启用内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(121)

评论列表共有 0 条评论

立即
投稿
返回
顶部