sp_databases

Description

Returns a list of databases on a target DBMS.

Syntax

sp_databases

Parameters

None.

This procedure does not allow parameters.

Usage

Information is based on the SYSDATABASE system catalog table.


Results

sp_databases returns a list of databases available to the client. Results are ordered by DATABASE_NAME.

The lengths for varchar columns shown in the result set tables are maximums; the actual lengths depend on the target database.

Table 4-9 shows the result set for sp_databases.

Table 4-9: Result set for sp_databases

Column

Datatype

Description

DATABASE_NAME

varchar(32)

NOT NULL

Name of an available database

DATABASE_SIZE

int

Size of the named database in kilobytes, otherwise NULL

REMARKS

varchar(254)

Always NULL