db_id

Description

Returns the ID number of the specified database.

Syntax

db_id(database_name)

Parameters

database_name

is the name of a database. database_name must be a character expression. If it is a constant expression, it must be enclosed in quotes.

Examples

Example 1

select db_id("sybsystemprocs")

------
4

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute db_id.

See also

Functions db_name, object_id