Expensive Queries along with Program_name its belong

  • We need to find expensive queries along with "Program_name" it's belong.

    We can easily find expensive queries using DMVs (sys.dm_exec_query_stats, sys.dm_exec_sql_text) but I am not able to link it with "Program_name" they belong, where as I have setup Data Collection and there I can see Program_name(see in green color), please help me to find the "Program_Name" without setup the Data Collection as it add load to the server.

  • The best way to do this would be to use extended events. You can add an action to any event to capture the program name. But, that has to be a part of the connection string and isn't required, so you may not always be able to capture it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply