我有确切的查询文字和准确的时间&执行查询的日期, 如何找到执行此查询的主机名?
我正在使用SQL Server 2008。
答案 0 :(得分:4)
答案 1 :(得分:1)
您可以将HostName()检查为
SELECT HOST_NAME() AS HostName, SUSER_NAME() LoggedInUser
http://blog.sqlauthority.com/2009/05/26/sql-server-find-hostname-and-current-logged-in-user-name/
或
SELECT @IP_Address = client_net_address
FROM sys.dm_exec_connections
WHERE Session_id = @@SPID;
How to get the client IP address from SQL Server 2008 itself?
How to identify the caller of a Stored Procedure from within the Sproc
答案 2 :(得分:1)
没有任何表格包含有关执行查询的主机的历史信息 - http://www.sqlservercentral.com/Forums/Topic1334479-146-1.aspx
答案 3 :(得分:0)