获取工作站客户端应用程序的 FQDN 是 运行

Get FQDN of workstation client application is running on

我想知道获取工作站客户端应用程序的 FQDN 的方法是 运行。我试过 HOST_NAME(),但它 returns 只有左边的部分。 我发现,sys.dm_exec_connections 很有用,但是只有客户端的工作站 IP 地址,没有 FQDN。

猜一猜,就是答案。

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,丹·古兹曼