SQL Server中的cmd_shell组件功能强大,几乎可通过该组建实现 Windows 系统 的所有功能,正因此,这个组件也是SQL Server的最大 安全 隐患。SQL Server 2000中这 编程客栈 个组件是默认开启的,而SQL Server 2005中这个组件默认作为此 服务器 安全配置的一部分而被关闭。有时我们需要用到该组件,开启此组件的相关语句如下:
复制代码 代码如下:
--To allow advanced options to be changed. 
EXEC sp_configure 'show advanced options', 1 
GO 
--To update the currently configured value for advanced options. 
RECONFIGURE 
GO -- To enable the feature. 
EXEC sp_configure 'xp_cmdshell', 1 
GO 
--To update   android  the currently configured value for this feature. 
RECONFIGURE 
GO
为了保证 数据库 服务器的安全,建议在使用完毕后关闭该组 http://HdhCmsTestcppcns测试数据 件,关闭该组件的相关语句如下:
复制代码 代码如下:
--To allow advanced options to be changed. 
EXEC sp_configure 'show advanced options', 1 
GO 
--To update the currently configured value for advanced options. 
RECONFIGURE 
GO -- To enable t  编程客栈  he feature. 
EXEC sp_configure 'xp_cmdshell', 0 
GO 
--To update the curr  python  ently configured value for this feature. 
RECONFIGURE 
GO
查看更多关于SQL Server 2005的cmd_shell组件的开启方法的详细内容...