次の方法で共有


ReadMediaHeader Method (Restore)

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The ReadMediaHeader method returns a QueryResults object enumerating the values of a backup media header record.

構文

object
.ReadMediaHeader(
Server
)
as
QueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Server
    SQLServer object connected to an instance of Microsoft SQL Server on which the backup device or operating system file is visible.

Prototype (C/C++)

HRESULT ReadMediaHeader(
LPSQLDMOSERVER ServerObject,
LPSQLDMOQUERYRESULTS* ppResults);

Returns

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

  1. Create a SQLServer object.

  2. Connect the SQLServer object to an instance of SQL Server on which the source backup device is visible.

  3. Create a Restore object.

  4. Set either the Devices, Files, Pipes, or Tapes property to indicate a device or operating system file visible on an instance of SQL Server created in Step 1 and maintaining the backup media.

  5. Call the ReadMediaHeader method of the Restore object using the SQLServer object created in Step 1 as an argument.

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.

Applies To:

Restore Object

参照

その他の技術情報

メディア セットとメディア ファミリの使用

ヘルプおよび情報

SQL Server 2005 の参考資料の入手