Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the database name that is specified by the user in the database connection string. This is the database that is specified by using the sqlcmd -d option (USE database) or the ODBC data source expression (initial catalog =databasename).
This database is not the same as the default user database.
Transact-SQL Syntax Conventions
Syntax
ORIGINAL_DB_NAME ()
Remarks
If the initial database is not specified, the function returns an empty string.