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
Method 3 : Use sys.sysservers view
select srvname from sys.sysservers
Tags: tsql, BRH, SQL Server, #SQLServer,
Hi Madhivanan,
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?
select serverproperty('servername')
-Chintak
Chintak Chhapia ,
Yes you can also use that query