I am trying to create a script that uses a cursor based on the select statement:
SELECT name, database_id FROM sys.databases
The scope of the script is to build and execute a BACKUP DATABASE statement for all of the databases identified in the SELECT name statement. I created the following backup statement:
BACKUP DATABASE model
TO DISK = 'C:DBBackupsmodel.bak'
WITH INIT
There should be a select statement included to print the value of the of the SQL variable holding the BACKUP DATABase command