Hi all,
We have a requirement to backup one of our MSSQL databases automatically every night. I have done this via a Scheduled Job in MSSQL Server Management Studio and it works fine. However the script that I am using overwrites the previous back up each time a new backup is created where really we would like the old backups to be kept (really we only want to keep about a weeks worth but that just makes it even more complicated). Now I am extremely new to any form of scripting so bear with me.
This is the script I have used at the moment:
-- Script to backup database
BACKUP DATABASE [Test]
TO DISK = N'D:\MSSQL\BACKUP\Test.bak'
Does anyone know what I need to add to this to stop each backup from overwriting the previous one?
Thanks