ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在SQL Server 2005中启用xp_cmdshell

在SQL Server 2005中启用xp_cmdshell

原创 Linux操作系统 作者:hawkx 时间:2008-05-13 14:41:59 0 删除 编辑
在SQL Server 2005中,xp_cmdshell默认是被禁止使用的,使用xp_cmdshell会得类似这样的提示:
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server.

如果你是管理员,可以用以下语句启用xp_cmdshell
首先用SQL Server Management Studio Express连接到数据库服务器,然后运行下面的SQL语句:
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'xp_cmdshell',1
reconfigure
go
然后你就可以使用xp_cmdshell了。

如果服务器上的xp_cmdshell存储过程被删除掉了,还可以在master数据中运行下面的SQL语句加回来
sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/634491/viewspace-265305/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-01-17

  • 博文量
    37
  • 访问量
    140155