Displays the ID number of the specified database.
db_id(database_name)
select db_id("sybsystemprocs")
------ 4
If you do not specify a database_name, db_id returns the ID number of the current database.
See also Transact-SQL Users Guide.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute db_id.