April 13, 2007 at 8:24 am
Hello,
I have been testing out getting Database Mail notifications for a SQL Server 2005 transaction log backup, and I see that the T-SQL included in part of the job is as follows.
BACKUP LOG [MyDB] TO DISK = N'D:\Microsoft SQL Server\MSSQL.1\MSSQL\MyDB\MyDB_backup_200704130500.trn' WITH NOFORMAT, NOINIT, NAME = N'MyDB_backup_20070413050003', SKIP, REWIND, NOUNLOAD, STATS = 10 GO declare @backupSetId as int select @backupSetId = position from msdb..backupset where database_name=N'MyDB' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'MyDB' ) if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''MyDB'' not found.', 16, 1) end RESTORE VERIFYONLY FROM DISK = N'D:\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\MyDB\MyDB_backup_200704130500.trn' WITH FILE = @backupSetId, NOUNLOAD, NOREWIND
Am I correct in assuming that the job is running fine, in spite of the "Verify failed" text, since that looks like the error handling *if* the error condition appears?
I just want to be sure.
Thanks!
----
webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
April 13, 2007 at 9:10 am
I would never assume it worked. Instead if possible do a test restore somewhere else to make sure. If is then you need to figure out why this message is happening otherwise you may find yourself without any backup at all.
April 13, 2007 at 10:10 am
Great point, thanks.
---
webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply