다음을 통해 공유


ReadFileList Method

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

The ReadFileList method returns a QueryResults object enumerating the Microsoft SQL Server database files maintained on a backup media.

구문

object
.ReadFileList(
Server
)
as
QueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list

  • Server
    SQLServer object connected to an instance of SQL Server on which the backup device or operating system file is visible

Prototype (C/C++)

HRESULT ReadFileList(
LPSQLDMOSERVER ServerObject,
LPSQLDMOQUERYRESULTS* ppResults);

Returns

A QueryResults object containing one result set defined by these columns.

Column

Data type

Description

LogicalName

nvarchar(130)

Logical name for the database file.

PhysicalName

nvarchar(261)

Name of the operating system file implementing the database logical file.

Type

nvarchar(25)

When D, the operating system file maintains data. When L, the operating system file maintains log records.

FileGroupName

nvarchar(130)

Name of the filegroup to which the database file belongs. NULL for files maintaining log records.

Size

numeric(20, 0)

Size, in bytes, of the operating system file at the time that the backup image was created.

MaxSize

numeric(20, 0)

Maximum size, in bytes, that the operating system file can attain.

주의

When using the ReadFileList method, one of the Restore object device properties must indicate the device maintaining the backup media.

To use the ReadFileList 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 database files of the first backup set are enumerated.

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

When the media of a backup device is unused, such as when a disk device is empty, the ReadFileList method succeeds, returning an empty QueryResults object.

Applies To: