could @@SERVERNAME be redefined to return an alias

99 Views Asked by At

A vendor application has a routine that does some validation by using @@Servername in SQL. This returns the name of the instance but I would prefer it returned the name of the Alias (SQL defined) for that instance. Is it possible? Examples: Currently

DECLARE @ServerName SysName
select @ServerName = @@SERVERNAME
SELECT @ServerName as ServerName

returns the instance

ServerName
---------------------
MyDBServer\MyInstance

I would prefer that it could be configured somehow to return the SQL configured alias

ServerName
---------------------
customerAlias

Any help or insight would be appreciated.

0

There are 0 best solutions below