I\'m trying to write some SQL that will delete files of type \'.7z\' that are older than 7 days.
Here\'s what I\'ve got that\'s not working:
DECLARE
I know this is a little old but I wanted to share my frustrations with you all. I was having the same problem as a lot of these posts but nothing seemed to work. I then remembered that we have an encryption layer on the database called NetLib. This means that the backups are encrypted and as such, xp_delete_file cannot read the headers. I now use a batch file in the OS and call it from an agent job. Hope this helps someone.