Using below query you can get the host name and logged user name.
Syntax
- SELECT HOST_NAME() AS Host_Name, SUSER_NAME() [User_Name]
Example

In this blog we learn how to get the host name and logged user name.
Using below query you can get the host name and logged user name.
Syntax

Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyeBook · SQL ServerBasics of SQL ServerDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
SubashPosted Sep 7, 2016, 4:16 AM EDT
Good