增加一个任务。
-- Create the backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_2',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_2.dat'--Create the log backup device.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwindLog1',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwindLog1.dat'-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_2-- Update activity has occurred since the full database backup.-- Back up the log of the MyNwind database.
BACKUP LOG MyNwind
TO MyNwindLog1
-- Create the backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_2',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_2.dat'--Create the log backup device.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwindLog1',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwindLog1.dat'-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_2-- Update activity has occurred since the full database backup.-- Back up the log of the MyNwind database.
BACKUP LOG MyNwind
TO MyNwindLog1
@step_name = 'Set database to read only',
@subsystem = 'TSQL',
@command = 'exec backup database ....', ''true''',
@retry_attempts = 5,
@retry_interval = 5
如何建立JOB,看BOOKS ONLINE