set @backup_Query= 'backup database ['+ @databaseName + '] to disk = N''' + @backupPath + '\' + @DatabaseName + '.bak'' WITH RETAINDAYS =7 , COMPRESSION'
I have this script from the store procedure that run nightly.
Only Problem is that it appends to the backup. The backup file grow so large upto 102GB, but the database size is 748MB and it compresses to 458MB. I have limited storage.
If I have use INT code then it will overwrite the database and database wouldnt be that larger.
My thought is that I would like to keep retaindays up to 7 days only and it should keep adding up to the database whenever the backup job runs (which is appending) only up to 7 days but the problem is that it does not delete the old retain backup and it’s just keep on adding to the backup file.
How do I fix the problem?
I looked into the Ola scripts. Apparently I heard so many good things about it.
I want to apply this script to the entire instance. Or any other suggestion would be better?
Budget that I thought of is around $20 or offer me