Backup multiple SQL databases
Backup multiple SQL databases This is a query I use to backup all of my lab databases. I use System Center 2012 Orchestrator (SCORCH) to kick off a runbook which executes this query againsy my SQL servers to backup all of the databases. You know as well as I do, there are many ways to accomplish this task...some even easier, however, in attempts to use SCORCH more frequently, I decided to make a RunBook to which performed the job for me. Using SCORCH's "Query Database" activity, I pasted the following code in the query window and set the connection parameters and off it went. You can copy the code below and run it in a SSMS query window and it will work as well. ]------ Begin Code ------[ --declaring variables DECLARE @dbname VARCHAR(100) -- database name DECLARE @bupath VARCHAR(100) -- path for backup location DECLARE @filename VARCHAR(100) -- filename used for backup files DECLARE @datestamp VARCHAR(25) -- date used for backup file timestamp -- spec...