在tsql中执行命令

时间:2012-05-20 14:08:18

标签: sql-server-2008 xp-cmdshell

如何执行除dir以外的xp_cmdshell之类的系统命令?

1 个答案:

答案 0 :(得分:1)

我没有看到任何问题,这是一个例子:

dstest 是远程服务器......

enter image description here

修改

运行此命令以激活:

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