The Ultimate Running Requests Reporter

  • Comments posted to this topic are about the item The Ultimate Running Requests Reporter

  • Good one. Can you exclude the session_id where this script is running?

    [font="Courier New"]Sankar Reddy |[/url][/font]

  • 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?


    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]


  • 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.


    OUTER APPLY sys.dm_exec_sql_text(sql_handle) AS Statements

    OUTER APPLY sys.dm_exec_query_plan(plan_handle) AS QueryPlans

  • 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