How to Create an Extended Event in SQL Server - SQL Server DBA Tutorial

In this video you will learn how to create an Extended Event in SQL Server using SQL Server Management studio as well as using T-SQL Script. It also shows step by step process of creating a New Session, choosing events that you would like to capture, filtering the events data (fields) and saving the output to a disk location. It also demonstrates how to get list of Extended Events in SQL Server, how to watch Live Data of a session, how to analyze captured data and how to start and stop a session in extended events in SQL Server.

Script used in the video to Create Extended Event in SQL Server

CREATE EVENT SESSION [DatabaseEvent] ON SERVER 
ADD EVENT sqlserver.database_attached(
    ACTION(sqlserver.database_name,sqlserver.nt_username,sqlserver.username)),
ADD EVENT sqlserver.database_created(
    ACTION(sqlserver.database_name,sqlserver.nt_username,sqlserver.username)),
ADD EVENT sqlserver.database_detached(
    ACTION(sqlserver.database_name,sqlserver.nt_username,sqlserver.username)),
ADD EVENT sqlserver.database_started(
    ACTION(sqlserver.database_name,sqlserver.nt_username,sqlserver.username)) 
ADD TARGET package0.event_file(SET filename=N'C:\SQLSysBackup\DatabaseEvents.xel')
WITH (STARTUP_STATE=OFF)
GO


How to Create an Extended Event in SQL Server - SQL Server DBA Tutorial

3 comments:

  1. Is this a paid topic or do you change it yourself?
    However, stopping by with great quality writing, it's hard to see any good blog today.

    Active Data Studio Crack
    Clip Studio Paint EX Crack

    ReplyDelete
  2. I really enjoyed reading this article! I would like to learn more about the benefits of event services.Visual Merchandising in Bangalore

    ReplyDelete
  3. This is a beautiful post. This is a fantastic post. It stands out among other posts I've read in a long time. Inventory Management Software

    ReplyDelete