• First up I start with the SQL Server Profiler with a slightly changed version of the "SP_Counts" template. After my modifications [font="Arial Black"]I have based the template on the "SP:Starting" event [/font]with the following columns:

    ObjectName (name of the Stored Procedure)

    [font="Arial Black"]Duration [/font](not really needed, I'll explain the purpose later)

    DatabaseName (not really needed since we'll filter on the database anyway)

    SPID (mandatory, I don't want it but Profiler obviously need it)

    StartTime (same as Duration)

    [font="Arial Black"]EndTime [/font](same as Duration)

    Hmmmm.... I'm curious as to how you got "Duration" and "EndTime" to work on the "SP:Starting" event. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)