3

I created that extended event to identify long running queries on my database:

CREATE EVENT SESSION [queriesLentas] 
ON SERVER
ADD EVENT sqlserver.sql_statement_completed(
    ACTION(sqlserver.sql_text, sqlserver.tsql_stack)
    WHERE sqlserver.sql_statement_completed.duration > 1000
    )
ADD TARGET package0.asynchronous_file_target(
  SET filename='C:\queriesLentas.xet', metadatafile = 'C:\queriesLentas.xem'
  )
GO


ALTER EVENT SESSION queriesLentas ON SERVER
STATE = START
GO

But when I start this session, it only gets queries executed on SSMS, and do not get queries executed on my .NET application(so that I can easily track those long queries).

Is there a way to see queries executed from my .NET application through this extended event?

2

The problem you might be running in to is with the filter on duration. Extended Events only trigger when filters are met, so if no queries take 1000 microseconds or longer, they won't show in the Extended Events session data.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.