Here are the three different ways to know the Server name using queries
Method 1 : Use @@servername
select @@servername as server_name
Method 2 : Use sp_helpserver system procedure
Method 3 : Use sys.sysservers view
select srvname from sys.sysservers
Tags: tsql, BRH, SQL Server, #SQLServer,
I always read your posts and found them quite good.
Just to add to above three, Can we also use ServerProperty function as shown below?
Chintak Chhapia ,
Yes you can also use that query