查看完整版本: [-- SQL2005启用xp_cmdshell --]

风信Java论坛 ›› Microsoft SQL Server ›› SQL2005启用xp_cmdshell 登录 -> 注册

1F SQL2005启用xp_cmdshell   唧唧 Post by : 2009-03-05 16:49:02.0

-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 启用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
--重新配置
RECONFIGURE
GO

--执行想要的xp_cmdshell语句
Exec xp_cmdshell 'cmd'
GO

--用完后,要记得将xp_cmdshell禁用(出于安全考虑)
-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 禁用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 0
GO
--重新配置
RECONFIGURE
GO


风信Java论坛 ›› Microsoft SQL Server ›› SQL2005启用xp_cmdshell 登录 -> 注册

查看完整版本: [-- SQL2005启用xp_cmdshell --]
CopyRight © 2008-2009 JavaWind.Net Studio All Rights Reserved
Powered By JWind.BBS Vesion 1.0.0 Beta1 Processed in 7 ms,0 (Queries)  Gzip enabled
粤ICP备07511478号