Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Restore Verifyonly

Author  Topic 

shaggy
Posting Yak Master

248 Posts

Posted - 2012-02-13 : 10:38:07
Dear Friends,
It is known that Restore Verifyonly is to verify whether backupset is valid or not.It gives immediate result for small db backup whereas for large backup it takes more time as of restoring the DB.I want to know whether is there any quick\fast option to verify the backup set is valid or not.

Thanks
SG

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-13 : 10:41:51
Not to my knowledge



DECLARE @backupSetId int

SELECT @backupSetId = position
FROM msdb..backupset
WHERE database_name=N'<dbname>'
AND backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'<dbname>' )

IF @backupSetId is null
BEGIN
raiserror(N'Verify failed. Backup information for database ''myActions'' not found.', 16, 1)
END

RESTORE VERIFYONLY
FROM DISK = N'<file path>\<database backup file>.BAK'

WITH FILE = @backupSetId, NOUNLOAD, NOREWIND
GO




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -