SQL Server xp_delete_file parameters

mehdi lotfi picture mehdi lotfi · Jul 5, 2014 · Viewed 35.7k times · Source

Who can explain list of xp_Delete_file parameters in sql server. I don't find msdn document for this stored procedure.

I got script of xp_Delete_file from maintenance plan but didn't understand first parameter.

Answer

M.Ali picture M.Ali · Jul 6, 2014

Xp_delete_file take five parameters:

  1. File Type = 0 for backup files or 1 for report files.
  2. Folder Path = The folder to delete files. The path must end with a backslash "\".
  3. File Extension = This could be 'BAK' or 'TRN' or whatever you normally use.
  4. Date = The cutoff date for what files need to be deleted.
  5. Subfolder = 0 to ignore subfolders, 1 to delete files in subfolders.

Source How to Use xp_delete_file to Purge Old Backup Files by Patrick Keisler