@DbName (JavaScript)

Returns the server name and the database name of the current database.

Defined in

@Functions (JavaScript)

Syntax

@DbName() : string
Return value Description
string A list: the first element is the server name; the second element is the database name.

Examples

This computed field displays the database and server names of the current database.
var database = @Subset(@DbName(), -1);
var server = @Name("[CN]", @Subset(@DbName(), 1));
return database + " on " + server