Get SQL Server Name in MSSQL

How to get MSSQL Server name in MSSQL  ?

select @@servername

How to get user name in MSSQL  ?

SELECT SUSER_NAME() LoggedInUser

Advertisements