Stairway to SQL Server Extended Events Level 1: From SQL Trace to Extended Events

  • Erin Stellato

    Ten Centuries

    Points: 1176

    Comments posted to this topic are about the item Stairway to SQL Server Extended Events Level 1: From SQL Trace to Extended Events

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    What a great article. Thank you.

  • SQLKnowItAll

    SSC Guru

    Points: 61781

    Thanks Erin! I was waiting for a Stairway on this to direct my colleagues to. It seems, though, that the script portion of the article for creating an event session compared with creating a trace does not include the CREATE portion for the XE, only the IF EXISTS... DROP...

    Thanks,
    Jared
    PFE - Microsoft
    SQL Know-It-All
    How to post data/code on a forum to get the best help - Jeff Moden[/url]

  • Erin Stellato

    Ten Centuries

    Points: 1176

    Jared, you're correct! Listing 9 should have the following code:

    /* Extended Events */

    CREATE EVENT SESSION [XE_ReadsFilter_Trace]

    ON SERVER

    I have notified SSC and we'll get it updated, thanks for letting me know!

    Erin

  • Tom_Hogan

    Hall of Fame

    Points: 3460

    Great article. Thanks.

  • WAL

    Mr or Mrs. 500

    Points: 594

    Unfortunately this sp(sp_SQLskills_ConvertTraceToExtendedEvents) does not work on SQL Server 2008, because sys.trace_xe_event_map system table was introduced later in v11. 🙂

  • Erin Stellato

    Ten Centuries

    Points: 1176

    Correct, the script does only work for SQL Server 2012 and higher, and this is noted in the post. If you're using SQL Server 2008R2 and below, stick with Trace.

  • Misha_SQL

    SSCertifiable

    Points: 5385

    This is great! I've been procrastinating on switching from SQL Trace to Extended Events. Now I have no excuse! (well, maybe until this stairway series is finished :Whistling: )

  • SQLSCCOM

    SSC Rookie

    Points: 31

    Hi Erin, 

         
          -- EndTime implemented by another Action in XE already      
           -- StartTime implemented by another Action in XE already 
     
    Could you please elaborate on these two, I would like to have these columns along with all other info I'm getting with rpc_completed extended event session. 
    If these are from another action in XE, could you tell action name like sqlos, sqlserver .. etc.. ) 

    -- NICE SERIES on XE..

  • Erin Stellato

    Ten Centuries

    Points: 1176

    SQLSCCOM - Thursday, April 13, 2017 10:01 PM

    Hi Erin, 

         
          -- EndTime implemented by another Action in XE already      
           -- StartTime implemented by another Action in XE already 
     
    Could you please elaborate on these two, I would like to have these columns along with all other info I'm getting with rpc_completed extended event session. 
    If these are from another action in XE, could you tell action name like sqlos, sqlserver .. etc.. ) 

    -- NICE SERIES on XE..

    Hi-

    StartTime and EndTime aren't implemented as separate elements in Extended Events.  The rpc_completed event has a timestamp column, which is the end of the event.  You can use duration to calculate the start time.  There are issues to be aware of related to the timestamp, see Jon's post: https://www.sqlskills.com/blogs/jonathan/incorrect-timestamp-on-events-in-extended-events/

    Erin

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply