Returns the database name.
DB_NAME ( [ database-id ] )
CIS functional compensation performance considerations apply.
Parameter
Description
database-id
The ID of the database. database-id must be a numeric expression
VARCHAR
Returns the database name iqdemo, when executed against the demo database:
SELECT DB_NAME( 0 ) FROM iq_dummy
If no database-id is supplied, the name of the current database is returned.
SQL—Vendor extension to ISO/ANSI SQL grammar.
Sybase—Adaptive Server Enterprise function implemented for Sybase IQ.