Friday, March 30, 2012

How to verify the integrity of a back-up file prior to restore?

Hello,

I have some C# (.NET 2.0) code that performs back-ups and also can perform restores of back-up files. I would like to validate the integrity of a file prior to initiating a restore operation. In other words, I want to know, before I try to restore, if the file is just a random file (picture, work doc, zipped backup, etc.) or if it is a valid SQL backup file.

Any help would be greatly appreciated.

Thanks,

hassiahHi,

look at the Restore Class in SMO, it has a method for verifying the media.

Restore.SqlVerify()

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Jens,

Exactly what I needed... thanks a bunch! Sorry I didn't get back sooner.

hassiah

No comments:

Post a Comment