ORIGINAL_DB_NAME (Transact-SQL)
Applies to: SQL Server Azure SQL Managed Instance
Returns the database name specified by the user in the database connection string. This database is specified by using the sqlcmd-d option (USE database). It can also be specified with the Open Database Connectivity (ODBC) data source expression (initial catalog =databasename).
This database is different from the default user database.
Transact-SQL syntax conventions
Syntax
ORIGINAL_DB_NAME ()
Note
To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation.
Remarks
If the initial database isn't specified, the function returns an empty string.
See Also
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro