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
exec sp_helpserver
Read more: Beyond Relational
Method 1 : Use @@servername
select @@servername as server_name
Method 2 : Use sp_helpserver system procedure
exec sp_helpserver
Read more: Beyond Relational