Example:
Save the following paragraph as a Text Example of backupscript. SQL
-- Copying master data
Print 'replica master data output'
Backup database [Master] to disk = n' c: \ waterlike \ dB \ master. bak 'with noformat, init, name = n' Master', Skip, norewind, nounload, stats = 10, checksum
Go
Declare @ backupsetid as int
Select @ backupsetid = position from MSDB .. backupset where database_name = n 'master' and backup_set_id = (select max (backup_set_id) from MSDB .. backupset where database_name = n 'master ')
If @ backupsetid is null begin raiserror (n' confirm the loss. Unable to find the metadata 'master. ', 16, 1) End
Restore verifyonly from disk = n'c: \ waterlike \ dB \ master. Bak 'with file = @ backupsetid, nounload, norewind
Go
Save the following parts into a batch of shards:
@ Path = c: \ Program Files \ Microsoft SQL Server \ 90 \ tools \ binn; % Cd %;
Sql0000.exe-I backupscript. SQL-O backupreport.txt
Put them in the same path, and then the computer sets a schedule to regularly run a batch of orders.