ASA SQL Reference
SQL Functions
Alphabetical list of functions
Returns the database ID number.
DB_ID ( [ database-name ] )
database-name A string containing the database name. If no database-name is supplied, the ID number of the current database is returned.
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Compatible with Adaptive Server Enterprise.
The following statement returns the value 0 if asademo is the only running database:
SELECT DB_ID( 'asademo' )
The following statement returns the value 0 if executed against the only running database.
SELECT DB_ID()