May 3, 2009 at 9:13 pm
Comments posted to this topic are about the item The Ultimate Running Requests Reporter
May 27, 2009 at 10:41 pm
Good one. Can you exclude the session_id where this script is running?
[font="Courier New"]Sankar Reddy | http://SankarReddy.com/[/url][/font]
May 25, 2010 at 8:51 am
Hello,
Congrats on the great script. Very useful!
I have added below a script that would be a great addition to your code. It produces the IP address of the workstation connected. I found it at SQL Central. It would helpful if the user is connected with SQL authentication.
What do you think?
Rudy
SELECT ec.client_net_address AS 'IP Address of Client', es.[program_name] AS 'Name of Application',
es.[host_name] AS 'Host/Computer Name', es.login_name AS 'ID Used',
COUNT(ec.session_id) AS 'Connection Count', @@SERVICENAME AS 'Instance User Is Connected To'
FROM sys.dm_exec_sessions AS es
INNER JOIN sys.dm_exec_connections AS ec
ON es.session_id = ec.session_id
GROUP BY ec.client_net_address, es.[program_name], es.[host_name], es.login_name
ORDER BY ec.client_net_address, es.[program_name]
Rudy
December 27, 2010 at 4:24 am
Due to the use of Cross Apply, this will only return rows where the Statement and QueryPlans are available. Change it to an OUTER APPLY to gather all spids.
ie
OUTER APPLY sys.dm_exec_sql_text(sql_handle) AS Statements
OUTER APPLY sys.dm_exec_query_plan(plan_handle) AS QueryPlans
May 19, 2016 at 7:03 am
Thanks for the script.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply