May 8, 2003 at 2:37 pm
Is there a way to automate differential backups the same way that full/tran backups are in the Maint. Plans? Or do you have to just schedule a backup command as a job?
-Dan
-Dan
May 8, 2003 at 3:21 pm
May 9, 2003 at 3:22 am
This is the TSQL used in my job to perform the Differential backup of all my databases to tape except distribution, master, model and tempdb.
ALso I change my tape out on Friday so I have the tape automatically unload for me to save time.
DECLARE @dbname sysname
DECLARE @sql varchar(2000)
SET @dbname = (SELECT TOP 1 [name] FROM sysdatabases WHERE [name] != 'tempDb' ORDER BY [name] DESC)
SET @sql = 'IF DatePart(w,GetDate()) = 6 AND ''?'' = (''' + @dbname + ''')
begin
BACKUP DATABASE
TO TAPE = ''\\.\Tape0''
WITH
DIFFERENTIAL,
UNLOAD,
NAME = ''? Full Backup ' + RTRIM(CONVERT(CHAR,GETDATE(),101)) + '''
end
else
begin
if ''?'' NOT IN (''distribution'',''master'',''model'',''tempdb'')
begin
BACKUP DATABASE
TO TAPE = ''\\.\Tape0''
WITH
DIFFERENTIAL,
NOUNLOAD,
NAME = ''? Full Backup ' + RTRIM(CONVERT(CHAR,GETDATE(),101)) + '''
end
end
'
EXEC sp_MSForEachDB @sql
May 16, 2003 at 9:56 am
Thanks for the script...maybe in the next version of SQL Server it will be just another tab in the Maint. Plan...
-Dan
-Dan
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply