Returning the Current SQL Server Instance Name and SQL Server Version : SERVERNAME « System Settings « SQL Server / T-SQL Tutorial






4>
5> SELECT @@SERVERNAME ServerName
6> GO
ServerName

------------------------------------------------------------------------------------------------------------------------
--------
BCE67B1242DE45A\SQLEXPRESS


(1 rows affected)








26.29.SERVERNAME
26.29.1.Returning the Current SQL Server Instance Name and SQL Server Version