1

使用 SQL Server 2000 我正在尝试在查询分析器中使用此命令

xp_cmdshell 'del c:\delete-me-file.txt'

我收到了这个错误:

服务器:消息 2812,级别 16,状态 62,第 1 行
找不到存储过程“xp_cmdshell”。

基本上我想从系统中删除这个文件......我需要运行什么命令来做到这一点?

4

1 回答 1

3

您需要在master数据库的上下文中或使用 db 名称作为扩展存储过程的前缀。

EXEC master..xp_cmdshell 'del c:\delete-me-file.txt' 

如果此命令成功,则表明 SQL Server 服务帐户可能具有太多权限。

于 2012-01-13T18:57:13.743 回答