Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Verify a database backup using T-SQL

By Nakul Vachhrajani,

The RESTORE command provides the facility to very easily validate a backup (taken via SQL Server, not via 3rd party utilities like SQLLite). This T-SQL code can help in ensuring that the backup file is structurally consistent, and therefore helps rule out I/O issues.

The checks performed by RESTORE VERIFYONLY include (per Books On Line):

  • That the backup set is complete and all volumes are readable
  • Some header fields of database pages, such as the page ID (as if it were about to write the data)
  • Checksum (if present on the media)
  • Checking for sufficient space on destination devices

This script has also been published on my blog at:


Before running the script, please substitute the backup location and the code for the database files to suit your database configuration.



Nakul Vachhrajani,

Be courteous. Drive responsibly.

Total article views: 1722 | Views in the last 30 days: 6
Related Articles

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.


xmla script for automate ssas database backup

xmla script for automate ssas database backup


Script to Check the Database Backup duration

Script to Check the Database Backup duration of entire instances


Backup & Restoration Script

This script provides very useful information about database backup and restoration.


Database Backup Information Scripts

Scripts used to validate the backups information as below 1) Database Backups for all databases F...


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones