Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Emailing Session Events for Extended Events.

$
0
0

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.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>