Many developers, at times, are required to write and debug code on the production copy of the database, so it makes more sense to refresh the database on regular basis.
Let’s build the process to automate the database refresh activity using a simple backup-and-restore method and scheduling it using SQL Server Agent.
- Restore the database to the same server with a different name
- Restore the database to a different server using sqlcmd and Robocopy utility
- Schedule the job
Let’s take a closer look at the process to see how this works.
Continue reading Backup and Restore Automation using SQLCMD and SQL Server agent