SQL Server中的cmd_shell组件功能强大几乎可通过该组建实现Windows系统的所有功能正因此这个组件也是SQL Server的最大安全隐患SQL Server 中这个组件是默认开启的而SQL Server 中这个组件默认作为此服务器安全配置的一部分而被关闭有时我们需要用到该组件开启此组件的相关语句如下
复制代码 代码如下:
To allow advanced options to be changed
EXEC sp_configure show advanced options
GO
To update the currently configured value for advanced options
RECONFIGURE
GO To enable the feature
EXEC sp_configure xp_cmdshell
GO
To update the currently configured value for this feature
RECONFIGURE
GO
为了保证数据库服务器的安全建议在使用完毕后关闭该组件关闭该组件的相关语句如下
复制代码 代码如下:
To allow advanced options to be changed
EXEC sp_configure show advanced options
GO
To update the currently configured value for advanced options
RECONFIGURE
GO To enable the feature
EXEC sp_configure xp_cmdshell
GO
To update the currently configured value for this feature
RECONFIGURE
GO