Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize


SQL Server 2000

Returns the physical names and attributes of files associated with the current database. Use this stored procedure to determine the names of files to attach to or detach from the server.


sp_helpfile [ [ @filename = ] 'name' ]


[@filename =] 'name'

Is the logical name of any file in the current database. name is sysname, with a default of NULL. If name is not specified, the attributes of all files in the current database are returned.

Return Code Values

0 (success) or 1 (failure)

Result Sets
Column name Data type Description
name sysname Logical file name.
fileid smallint Numeric identifier of the file.
filename nchar(260) Physical file name.
filegroup sysname Group to which the file belongs. Database files can be grouped in file groups for allocation and administration purposes. Log files are never a part of a file group.
size nvarchar(18) File size.
maxsize nvarchar(18) Maximum size to which the file can grow. UNLIMITED value in this field indicate that the file grows until the disk is full.
growth nvarchar(18) Growth increment of the file. This indicates the amount of space added to the file each time new space is needed.
usage varchar(9) Usage of the file. For a data file, the usage is data only and for the log file the usage is log only.


Execute permission defaults to the public role.


This example returns information about the files in pubs.

USE pubs
EXEC sp_helpfile

See Also





System Stored Procedures

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft