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

Returns the ID number of sybsystemprocs:

select db_id("sybsystemprocs")
------
4

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute db_id.

See also

Functions db_name, object_id