Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.41 KB

original-db-name-transact-sql.md

File metadata and controls

39 lines (32 loc) · 1.41 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
ORIGINAL_DB_NAME (Transact-SQL)
ORIGINAL_DB_NAME (Transact-SQL)
VanMSFT
vanto
03/06/2017
sql
t-sql
reference
ORIGINAL_DB_NAME
ORIGINAL_DB_NAME_TSQL
ORIGINAL_DB_NAME function
TSQL

ORIGINAL_DB_NAME (Transact-SQL)

[!INCLUDE 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.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

ORIGINAL_DB_NAME ()  

Remarks

If the initial database isn't specified, the function returns an empty string.

See Also

sqlcmd Utility
osql Utility
SQL Server Native Client (ODBC)