How to delete a file [Resolved]

Posted by Mahendrabasutkar under Sql Server on 7/11/2011 | Points: 10 | Views : 1239 | Status : [Member] | Replies : 2
How to delete a file present in a perticular drive using sql server 2000

Regards
mahendrabasutkar




Responses

Posted by: RaviRanjanKr on: 7/11/2011 [Member] Starter | Points: 50

Up
0
Down

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

if the xp_cmdshell extended procedure has not been enabled yet then it will generate error message so to accomplish you task you need to enable it.
for more details you can navigate given link
http://www.kodyaz.com/articles/delete-file-from-sql-server-xp-cmdshell-ole-automation-procedures.aspx

Thanks
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: PandianS on: 7/11/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi

To delete a file from SQL Server
EXEC xp_delete_file 0,'E:\DotNetFunda\Funda.sql'



Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response