Ham-416672
SSChasing Mays
Points: 611
More actions
September 10, 2007 at 10:16 am
#176568
Hello,
I have a file located in c:\test.jpg that I want to do delete using T-SQL, how can I do this? (need to use this later in a DELETE trigger to remove image files)
John Eisbrener
Mr or Mrs. 500
Points: 509
September 10, 2007 at 1:44 pm
#732597
Use xp_cmdshell
As an example:
EXEC xp_cmdshell 'del C:\test.jpg'
Check BOL for any restrictions on using this sp.
Anders Pedersen
SSChampion
Points: 11410
September 10, 2007 at 2:12 pm
#732602
Could possibly also use xp_delete_file
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply