The ReadBackupHeader method returns a QueryResults object enumerating the contents of the media maintained by a backup device or operating system file.
object.ReadBackupHeader( Restore ) as QueryResults
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list |
Restore | Restore object with properties set to specify a backup device or file and, optionally, a backup set |
A QueryResults object containing one result set. For a description of the result set contents, see ReadBackupHeader Method (BackupDevice).
When using the ReadBackupHeader method, one of the Restore object device properties must indicate the device or file maintaining the backup media.
To use the ReadBackupHeader method
SQL Server can share backup media with other operating system utilities that perform backup of other data, and the media in a device may contain headers created by other utilities.
When the media of a backup device is unused, such as when a disk device is empty, the ReadBackupHeader method succeeds, returning an empty QueryResults object.
HRESULT ReadBackupHeader(
LPSQLDMORESTORE Restore,
LPSQLDMOQUERYRESULTS* ppResults);