SQL Server 2008 Extended Events 3

Now lets create a New Event Session to capture Deadlock Victims IF EXISTS(SELECT * FROM sys.server_event_sessions WHERE name=’Demo_session_Deadlock’) DROP EVENT SESSION Demo_session_Deadlock ON SERVER GO — CREATES THE SESSION CREATE EVENT SESSION Demo_session_Deadlock ON SERVER ADD EVENT sqlserver.lock_deadlock ( ACTION ( sqlserver.database_id, sqlserver.client_app_name, sqlserver.sql_text ) ) ADD TARGET package0.asynchronous_file_target — CONFIGURES THE FILE TARGET (set…

SQL Server 2008 Extended Events 1

SQL Server 2008 Extended Events 1: This is a new bee article for Extended Events. –Now quickly searching to view all events based on sql keyword select * from sys.dm_xe_objects where OBJECT_type = ‘event’ and name like’%sql%’ –Now for viewing all object columns of any events select * from sys.dm_xe_object_columns where [object_name] = ‘sql_statement_completed’ –To…