Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ORIGINAL_DB_NAME (Transact-SQL)

ORIGINAL_DB_NAME (Transact-SQL)

 

Applies To: SQL Server 2014, SQL Server 2016 Preview

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.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions


ORIGINAL_DB_NAME ()

If the initial database is not specified, the function returns an empty string.

Community Additions

ADD
Show:
© 2015 Microsoft