November 26, 2001 at 2:02 pm
I am storing the names of files which have been uploaded to my server in a column called uploaded. All of these files are in the same directory on the server.
I need to have the actual files deleted when the corresponding record is deleted from the database. Is this possible with a DELETE Trigger? I am very new to T-SQL so any code would be helpful.
Thanks
November 26, 2001 at 2:26 pm
It is possible. You could use xp_cmdshell to issue a a 'delete filename'.
Andy
November 26, 2001 at 2:40 pm
Be sure to check security. The account under which SQL Server runs needs to have rights to delete these files from the OS.
Steve Jones
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy