您的位置:首页 > 运维架构 > Shell

sqlserver开启'xp_cmdshell'命令

2014-08-18 14:02 253 查看
--sql server中开启xp_cmdshell命令

1、

--允许配置高级选项

EXEC sp_configure 'show advanced options', 1

GO

RECONFIGURE

GO

2、

--开启xp_cmdshell服务

EXEC sp_configure 'xp_cmdshell', 1

RECONFIGURE

GO

3、

--使用 xp_cmdshell

master..xp_cmdshell 'copy e:\databasebackup\test.bak m:'

4、

-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
-- 禁用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 0
GO
RECONFIGURE
GO
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: