Share via


ReadBackupHeader Method (Restore)

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The ReadBackupHeader method returns a QueryResults object enumerating the contents of the media maintained by a backup device or operating system file.

구문

object
.ReadBackupHeader(
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 device or file is visible.

Prototype (C/C++)

HRESULT ReadBackupHeader(
LPSQLDMOSERVER ServerObject,
LPSQLDMOQUERYRESULTS* ppResults);

Returns

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

  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 visible on an instance of SQL Server indicated in Step 2 and maintaining the backup media. Specify only a single device or file.

  5. If desired, set the FileNumber property to indicate a specific backup set by ordinal location on the media. By default, the header of the first backup set on the media is enumerated.

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

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.

Applies To:

Restore Object