首页 > MSSQL > 在SQL Server中使用SQL命令删除文件

在SQL Server中使用SQL命令删除文件

2010年11月3日 浏览次数(68)
发表评论 阅读评论
exec master.dbo.xp_cmdshell 'del D:\test.txt'  

这个语句可以用来删除D盘下的test.txt文件

如果'xp_cmdshell'没有启用,可以使用下列语句启用'xp_cmdshell':

exec sp_configure 'show advanced options', 1;
reconfigure;
exec sp_configure 'xp_cmdshell', 1;
reconfigure;
分类: MSSQL
  1. 2010年11月3日14:30 | #1

    我 轻轻地飘过但没有带走云彩~~

  1. 本文目前尚无任何 trackbacks 和 pingbacks.
:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: