--DOS命令
exec xp_cmdshell'mkdir D:\project'
--启用 sp_configure 打开 xp_cmdshell
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE
exec xp_cmdshell'mkdir D:\project'
--启用 sp_configure 打开 xp_cmdshell
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE
本文介绍如何在SQL Server中使用xp_cmdshell存储过程来执行Windows命令行指令。通过两个实例展示了如何开启该功能及使用exec命令执行DOS命令,如创建文件夹。
1万+

被折叠的 条评论
为什么被折叠?



