I have a live database which i would like to create a backup and restore script that will take the "live" database every night, create a back, then drop the existing "testing" database (if any) and restore the same .bak file (on the same server) into a new database, this way, i always have the most up-to-date database to test on.
here are the steps:
- back up database ABC (call it abc.bak)
- drop (or clean/clear) database abc_test
- restore abc.bak into abc_test
Please let me know if anyone know or have a script that does so.