Do stored procedures have the ability to delete a file from the OS?

sql-server, sql-server-2005, stored-procedures

Solution

Technically, with the correct permissions, you could execute xp_cmdshell to issue commands to the OS (or call a batch file, whatever), but it's probably not a good idea. If you do use that method, be very strict about permissions.

Edited for clarity.

Problem

Out of curiosity, does a stored procedures have the ability to delete a file from the OS? If not I will have to make a windows Batch file that deletes the file and then runs the stored procedure using OSQL.

Original source