我能做什么"本地"使用查询进行系统调用?

时间:2016-10-05 10:48:04

标签: sql-server sql-server-2008

我目前在主机(A)上,连接到服务器(B)上的MSSQL数据库。 当我进行系统调用时,例如

EXEC xp_cmdshell 'Systeminfo' GO

从MS SQL 2008中,它始终从客户端返回系统信息(A)我当前正在运行我的SQL管理工具。 是否有可能运行系统调用,从服务器(B)返回信息?

1 个答案:

答案 0 :(得分:0)

我已经重新启动了这个问题,并再次尝试了所有步骤: 1.关闭本地服务器 2.连接到外部服务器 3.使用

打开外部服务器的XP_CMDSHELL命令
 -- To allow advanced options to be changed.  
 EXEC sp_configure 'show advanced options', 1;  
 GO  
-- To update the currently configured value for advanced options.  
RECONFIGURE;  
GO  
-- To enable the feature.  
EXEC sp_configure 'xp_cmdshell', 1;  
GO  
-- To update the currently configured value for this feature.  
RECONFIGURE;  
GO  

然后运行

EXEC xp_cmdshell 'Systeminfo';
GO

很奇怪它现在有效,因为过去几周我无法工作。

相关问题