Problem with SQL Server maintenance cleanup tasks RRS feed

  • Question

  • I've had problems trying to get a new maintenance plan on a new server to work.

    I'm running a plan that does an integrity check, reindex, shrink, backup, the a maint cleanup to get rid of backups older than 2 weeks.

    I'm getting failures that say:

    Error Number

    Error Message:
    Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'',N'BAK',N'2007-10-18T18:43:41',1
    " failed with the following error: "Error executing extended stored procedure: Invalid Parameter". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    Yes, this is a post SP2 server.
    Current version, with the patches I've applied looking to fix this is: 9.0.3054

    Additionally, if you go in to edit a maintenance cleanup task, you cannot click on OK, or the T-SQL.  Changing values within it does not help.

    Any clues?

    Friday, November 2, 2007 1:35 AM


  • In the Clean up Task in the place where you specified file extension you need to give "bak" incase if you had accidentally given it as ".bak" it might not work. I know that it sounds silly but that might also lead to not deleting the files. The above given point might be one of the reason for the cleanup task failing to delete.

    • Proposed as answer by SQLR12345 Friday, August 3, 2012 3:11 PM
    • Marked as answer by pituachMVP Monday, December 9, 2013 7:00 AM
    Friday, November 2, 2007 1:54 AM