none
Emailing Session Events for Extended Events.

    Question

  • Hi All,

    I am using this code for LongRunning Queries.

    CREATE EVENT SESSION LongRunningQuery
    ON SERVER
     
    ADD EVENT sqlserver.sql_statement_completed
    ( 
    	ACTION (sqlserver.sql_text, sqlserver.tsql_stack) 
    	WHERE sqlserver.sql_statement_completed.duration > 60000
    ) 
    ADD TARGET package0.asynchronous_file_target
    (
    	SET filename='c:\LongRunningQuery.xet', 
    	metadatafile='c:\LongRunningQuery.xem'
    ) 
    GO 
     

    Here Instead of writing to XML file how can send an EMAIL if a query runs more than 1 minute in my server ?

    Thanks in advance.

    Monday, February 03, 2014 7:47 PM

Answers