Search code examples
t-sqlsql-server-2016

Get FQDN of workstation client application is running on


I'd like to know the way to get FQDN of workstation client application is running on. I've tried HOST_NAME(), but it returns only the left part. I've found out, that sys.dm_exec_connections is rather useful, but there is only client's workstation IP address, no FQDN.


Solution

  • Guess, that's the answer.

    Be aware that the HOST_NAME() can also return whatever was is specified in the connection string. You did not mention why you need the FQDN but you could build the connection string in the app with the host name connection string keyword (which varies by API) so that HOST_NAME() returns that value.

    TY, Dan Guzman