The ReadMediaHeader method returns a QueryResults object enumerating the values of a backup media header record.
object.ReadMediaHeader( Server ) as QueryResults
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list |
Server | SQLServer object connected to the Microsoft® SQL Server™ installation on which the backup device or operating system file is visible |
A QueryResults object containing one result set. For a description of the result set contents, see ReadBackupHeader Method (BackupDevice).
A database backup performed by SQL Server can target multiple devices of a single type and can span multiple media maintained by the device. To organize media used in backup, SQL Server defines the media set and media family. A media label, or header record, maintains data about a media’s location within a media set and media family.
To use the ReadMediaHeader method
When the media of a backup device is unused or unlabeled, such as when a disk device is empty, the ReadMediaHeader method succeeds, returning an empty QueryResults object.
HRESULT ReadMediaHeader(
LPSQLDMOSERVER ServerObject,
LPSQLDMOQUERYRESULTS* ppResults);
Understanding Media Sets and Families