sql database name code example
Example 1: server name sql server
SELECT @@SERVERNAME AS 'Server Name'
Example 2: sql get database name
To get the current database name use select db_name().
DB_NAME(Transact-SQL)
SELECT @@SERVERNAME AS 'Server Name'
To get the current database name use select db_name().
DB_NAME(Transact-SQL)