Returns the name of the SQL instance name that script or batch is currently running on.
@@SERVERNAME example:
USE AdventureWorks;
GO
//display SQL Server instance name///
SELECT @@SERVERNAME AS 'SQL Instance Name';
GO
Output:
......
SQL Instance Name
-------------------------------------------
WIN-07GEPFR79UX\MSSQLBETA2