• I've run into this so many times, especially the Maint Plan failing because it couldn't do integrity checks because a "user" was in the database. It then won't delete the old backups. I ended up putting the script below in a scheduled job that runs every 6 hours. Since then I haven't had a big problem with it.

    declare @file_name varchar(100)
    
    declare FileList cursor for
        select  physical_device_name
        from msdb.dbo.BackupMediaFamily bmf 
        left join msdb.dbo.BackupSet bs on bs.media_set_id = bmf.media_set_id
        WHERE  datediff(hh,bs.backup_start_date,getdate()) > 48 
        and datediff(hh,bs.backup_start_date,getdate()) < 168 
        and physical_device_name not like '%BEXVDI%'
        ORDER BY bs.backup_start_date desc
    
    OPEN FileList
    FETCH NEXT FROM FileList INTO @file_name
     WHILE (@@fetch_status  -1) 
      BEGIN
        --print @file_name
        SELECT @file_name = 'DEL ' + @file_name
        EXEC XP_CMDSHELL @file_name
        FETCH NEXT FROM FileList INTO @file_name
      END
    DEALLOCATE FileList

    Solved a lot of my major headaches.



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.