From: RG on
Is there a way to tell which spid, and in turn from which ip, ran a last
query found in sys.dm_exec_query_stats?

Thanks

From: Erland Sommarskog on
RG (nobody(a)nowhere.com) writes:
> Is there a way to tell which spid, and in turn from which ip, ran a last
> query found in sys.dm_exec_query_stats?

No. That spid may have disconnected since it rant the query.


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

From: RG on
What about ip address of the client?

"Erland Sommarskog" <esquel(a)sommarskog.se> wrote in message
news:Xns9CF2D615C8E1EYazorman(a)127.0.0.1...
> RG (nobody(a)nowhere.com) writes:
>> Is there a way to tell which spid, and in turn from which ip, ran a last
>> query found in sys.dm_exec_query_stats?
>
> No. That spid may have disconnected since it rant the query.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se
>
> Links for SQL Server Books Online:
> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> SQL 2000:
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>

From: Erland Sommarskog on
RG (nobody(a)nowhere.com) writes:
> What about ip address of the client?

You can only see the IP address of a connected client, in
sys.dm_exec_connections. (And provided that it connected over TCP/IP.(


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx