sp_helpdb: no parameters
Running sp_helpdb with no parameters produces a list like this:
exec sp_helpdb
go
name db_size owner dbid created status
--------- ------- ----- ----- ----------- -----------------------------------------
master 9.25 MB sa 1 Nov 13 2008 trunc. log on chkpt.
model 1.50 MB sa 3 Sep 1 2009 select into/bulkcopy, trunc. log on chkpt.
msdb 9.25 MB sa 4 Sep 1 2009 select into/bulkcopy, trunc. log on chkpt.
Northwind 3.94 MB sa 6 Sep 1 2009 select into/bulkcopy, trunc. log on chkpt.
pubs 2.13 MB sa 5 Sep 1 2009 select into/bulkcopy, trunc. log on chkpt.
tempdb 8.50 MB sa 2 Sep 30 2009 select into/bulkcopy, trunc. log on chkpt.
The output of sp_helpdb contains the following information:
- name is the database name.
- db_size is the total size of all files for the database.
- owner is the database owner.
- created is the day the database was created.
- status is the status of the database.
sp_helpdb: with a Database Name
When you run sp_helpdb with a database name the following output is produced:
exec sp_helpdb pubs
go
name db_size owner dbid created status
----- ------- ----- ----- ----------- ------------------------------------------
pubs 2.13 MB sa 5 Sep 1 2009 select into/bulkcopy, trunc. log on chkpt.
name fileid filename filegroup size maxsize growth usage
----- ------ --------------------------- ---------- ------- --------- ------ ---------
pubs 1 C:\MSSQL7\DATA\pubs.mdf PRIMARY 1408 KB Unlimited 10% data only
pubs_log 2 c:\mssql7\DATA\pubs_log.ldf NULL 768 KB Unlimited 10% log only
Besides the one-line list, you get a line for each file containing the following information:
- name is the files logical name.
- fileid is the file identifier.
- filename is the files physical name.
- filegroup is the filegroup that the file belongs to; if filegroup is null then it is a log file.
- size is the current size of the file.
- maxsize is the maximum size to which the file can grow.
- growth is the growth rate defined for the file.
- usage is data only or log only .