Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Query : Host name

I have the exact Query Text and the exact time & date the Query was executed, how can I find the Host Name that executed this query?

I'm using SQL Server 2008.

like image 292
Shahim Khlaifat Avatar asked Jun 16 '26 11:06

Shahim Khlaifat


1 Answers

Do you need @@SERVERNAME

SELECT @@SERVERNAME

will return the server name where the query was executed.


HOST_NAME will return the workstation name

SELECT HOST_NAME()
like image 181
Arulkumar Avatar answered Jun 18 '26 00:06

Arulkumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!