SQL Server 中启用xp_cmdshell的sql语句

来源:互联网 发布:知客还是支客 编辑:程序博客网 时间:2024/06/09 18:13

----------启用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

原创粉丝点击