long running quries

  • Hi,

    Is there any way to findout the long running quries without using profiler?

    Thanks

  • Sure... but the methods are all worse than using profiler... why the profiler phobia?

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

  • You can get some statistical data from sp_who2, which can point you in the direction, but short, resource intensive queries can up the counters there, so you have to know your queries and data pretty well.

  • If you don't like using the profiler GUI, you can use the sp_trace stored procedures. Easiest way is to generate the trace definition from profiler. Create the trace then script out the definition (File -> Export -> Script Trace Definition )

    You can then use that in a scheduled job, or just run from Query Analyser.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

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