There are two ways to create the TSQL script for restoring the RTC database. If you are familiar with TSQL, it’s fairly simple to write the script and set it as a job.
If you are not familiar with TSQL, there is a way to have the SQL Management studio write the script for you. Follow steps 1–5 as shown previously. However, instead of clicking OK, click the Script button at the top of the window and choose Script Action to New Query Window, as shown in Figure 14.9. Simply run the query to create the backup.
For the process outlined previously, the script is included here.
RESTORE DATABASE [rtc] FROM DISK = N'C:Program FilesMicrosoft SQL
ServerMSSQL10.MSSQLSERVERMSSQLBackup
tc.bak' WITH FILE = 1, NOUNLOAD,
REPLACE, STATS = 10
GO