Wednesday, March 21, 2012

Maintenance cleanup task not deleting files

Running SQL2005 STD.

I have a maintenance cleanup task that is not actually deleting the files that it should be.

Here's the most recently task generated T-SQL statement:

EXECUTE master.dbo.xp_delete_file 0,N'F:\Program Files\Microsoft SQL Server\MSSQL\BACKUP',N'bak',N'12/05/2006 10:42:08'

The problem is that the files aren't actually being deleted when the job runs. However, if I create a new job with the statement as a single step or run it manually from a query window then the files are deleted as expected.

Is there anything I should be looking for? The job runs as 'sa' and I connect to the database engine using 'sa'... any ideas?

Thanks!Hi Davve,

Do you get an error message saying the the job has failed or does it appear to run successfully?

If its the latter is it possibly you can run sql profiler and run the job so we can help you further.

Pace
|||

Please file a defect report for this issue at http://connect.microsoft.com/sqlserver. We use issues reported by customers to prioritize future work including service packs.

What is the version number of SQL Server Management Studio you are running? You can check in the About... dialog shown by clicking the "Help | About..." menu item in SSMS.

Thanks,
Steve

|||It turns out that after a routine reboot of the server, the following time the job ran it deleted the files. Thanks for the replies.

No comments:

Post a Comment