Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Get Host Name And User Name In SQL Server
WhatsApp
Pankaj Kumar Choudhary
8y
4.4
k
0
1
25
Blog
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
SQL Server
Up Next
Could Not Find Server 'Server Name' In sys.servers In SQL Server
Ebook Download
View all
Functions in SQL Server: Practical Guide
Read by 9k people
Download Now!
Learn
View all
Membership not found