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

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

  • What a great article. Thank you.

  • 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...

    Jared
    CE - Microsoft

  • 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

  • Great article. Thanks.

  • 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. 🙂

  • 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.

  • 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: )

  • 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..

  • 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