Verify a database backup using T-SQL

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)