EnumFiles Method (Database) (SQL-DMO)

The EnumFiles method returns a QueryResults object enumerating the operating system files used to implement Microsoft® SQL Server™ database storage.

Applies To

Database Object

Syntax

object.EnumFiles() as QueryResults

Part Description
object Expression that evaluates to an object in the Applies To list

Returns

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

Column Data type Description
fileid smallint System-generated identifier of the operating system file.
groupid smallint System-generated identifier of the filegroup containing the operating system file. 0 for files implementing transaction log storage.
size integer Size of the file expressed as number of pages contained. For SQL Server version 7.0, a page is 8192 bytes.
maxsize integer Maximum size if set, -1 if no maximum specified.
growth integer Growth factor. When file grows by a fixed percentage, the value is the percentage multiplied by 100. When the file grows by a fixed size increment, the increment is expressed as a number of pages.
status integer Bit-packed flag value indicating creation or other attributes as described in Remarks.
perf integer Reserved.
name nchar(129) Logical name of the operating system file.
filename nchar(261) Operating system name of the file.

Remarks

The status column of the returned result set is a bit-packed value. Interpret the status column by using these values.

Value Description
1 Reserved
2 Operating system file maintains database data
64 Operating system file maintains transaction log records
128 Operating system file has been written to after most recent backup
16384 Operating system file implicitly created as part of database creation or alteration
32768 Operating system file explicitly created as part of database creation or alteration
1048576 File growth value is interpreted as a percentage

Prototype (C/C++)

HRESULT EnumFiles(
LPSQLDMOQUERYRESULTS* ppResults);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.