I studied how to delete a specific backup file using an SQL query , but I only find results about deleting backups older than the date. This is not what I want. I want to keep old backups, but I want to delete a specific backup by its identifier.
I can easily delete records from msdb tables and their recovery history for this backup, but I would like to be able to delete files also through an SQL query ( I know their full path , since it is stored in the database), so that they donβt lose disk space.
The procedure "xp_delete_file" does not seem to allow the deletion of a specific file.
I assume that if there is a procedure for deleting old files, there must be some way to delete a specific file. Please do not worry about security here.
source share