sqlserver启用通过sql语句远程访问权限

Posted zyb2016

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sqlserver启用通过sql语句远程访问权限相关的知识,希望对你有一定的参考价值。

 
启用Ad Hoc Distributed Queries: 
exec sp_configure ‘show advanced options‘,1   #这个配置默认是开启的
reconfigure 
exec sp_configure ‘Ad Hoc Distributed Queries‘,1   #这个配置用于允许远程访问权限
reconfigure 
   
关闭Ad Hoc Distributed Queries: 
exec sp_configure ‘Ad Hoc Distributed Queries‘,0 
reconfigure 
exec sp_configure ‘show advanced options‘,0 
reconfigure
 
使用方法

SELECT * into OD_OP
FROM opendatasource( ‘SQLOLEDB ‘, ‘Data Source=192.168.0.99,1433;User ID=sa;Password=huixin ‘ ).TY2010.dbo.op


以上是关于sqlserver启用通过sql语句远程访问权限的主要内容,如果未能解决你的问题,请参考以下文章