SQL 2008 启用和禁用xp_cmdshell

xp_,cmd,cmdshell

-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 禁用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
--重新配置
RECONFIGURE
GO

 允许开启

sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'xp_cmdshell',1
reconfigure
go


关闭

sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'xp_cmdshell',0
reconfigure
go

原文地址:https://www.cnblogs.com/cb168/p/4134696.html