Reports information about a specified database or all databases.
Total size of the database.
Database owner, such as sa.
Date the database was created.
Comma-separated list of values of database options that are currently set on the database.
Boolean-valued options are listed only if they are enabled. Non-Boolean options are listed with their corresponding values in the form of option_name=value.
For more information, see ALTER DATABASE (Transact-SQL).
Database compatibility level: 60, 65, 70, 80, or 90.
If name is specified, there is an additional result set that shows the file allocation for the specified database.
Logical file name.
Operating-system file name (physical file name).
Filegroup in which the file belongs.
NULL = file is a log file. This is never a part of a filegroup.
File size in megabytes.
Maximum size to which the file can grow. A value of UNLIMITED in this field indicates that the file grows until the disk is full.
Growth increment of the file. This indicates the amount of space added to the file each time new space is needed.
Usage of the file. For a data file, the value is 'data only' and for the log file the value is 'log only'.
When a single database is specified, membership in the public role in the database is required. When no database is specified, membership in the public role in the master database is required.
If a database cannot be accessed, sp_helpdb displays error message 15622 and as much information about the database as it can.
A. Returning information about a single database
The following example displays information about the AdventureWorks database.