---打开cmd开关
exec sp_configure 'xp_cmdshell','1';
RECONFIGURE;
---通过xp_cmdshell执行dos命令
exec xp_cmdshell 'del d:\test.txt';
---关闭开关exec sp_configure 'xp_cmdshell','1';