sql server 开xp_cmdhshell

来源:互联网 发布:淘宝云客服靠谱吗 编辑:程序博客网 时间:2024/05/16 18:17
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.bakm:'

4、
-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
-- 禁用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 0
GO
RECONFIGURE
GO
0 0
原创粉丝点击