I've been researching about how to delete a specific backup file through an SQL query, but I only find results about "deleting backups older than a date". That is not what I want. I want to keep old backups, but I want to be able to delete a specific backup by its ID.
I can easily remove the entries from the msdb tables and its restore history for a given backup, but I would like to be able to delete the files as well through an SQL query (I know their full path, as it is stored in the database), so that they don't keep wasting space in the disk.
The procedure "xp_delete_file" doesn't seem to allow to delete a specific file.
I assume that if there is a procedure to delete old files, there should be some way to delete a specific file. Please don't worry about security here.