Export (0) Print
Expand All
Expand Minimize

sp_databases

SQL Server 2000

  Topic last updated -- July 2003

Lists databases that reside in an instance of Microsoft® SQL Server™ or are accessible through a database gateway.

Syntax

sp_databases

Return Code Values

None

Result Sets
Column name Data type Description
DATABASE_NAME sysname Name of the database. In SQL Server, this column represents the database name as stored in the sysdatabases system table.
DATABASE_SIZE int Size of database, in kilobytes.
REMARKS varchar(254) For SQL Server, this field always returns NULL.

Remarks

In SQL Server, sp_databases returns the databases listed in the sysdatabases system table.

Database names that are returned can be used as parameters in the USE statement to change the current database context.

sp_databases has no equivalent in Open Database Connectivity (ODBC).

Permissions

Execute permissions default to the public role.

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