现在的位置: 首页 > 综合 > 正文

SQL Server 中启用xp_cmdshell的sql语句

2013年10月04日 ⁄ 综合 ⁄ 共 336字 ⁄ 字号 评论关闭

----------启用xp_cmdshell存储过程----------------------
--检查xp_cmdshell是否启动
exec master..xp_cmdshell 'dir'
go
--启动xp_cmdshell存储过程
exec sp_configure 'show advanced options',1
go
reconfigure
go
exec sp_configure 'xp_cmdshell',1
go
reconfigure
go

--关闭xp_cmdshell存储过程
reconfigure
go
exec sp_configure 'xp_cmdshell',0
go
reconfigure
go
exec sp_configure 'show advanced options',0
go

抱歉!评论已关闭.