Trace a particular sp

  • how to trace a particular sp in sql.

    tell me step by step

  • http://lmgtfy.com/?q=sql+server+trace

    Or this link

    http://technet.microsoft.com/en-us/library/ms175047.aspx

    AND this http://technet.microsoft.com/en-us/library/ms181091.aspx

    should be what you are looking for.


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • my question is particular sp.

    i dont find option to put its name

  • riya_dave (4/25/2012)


    my question is particular sp.

    i dont find option to put its name

    Which product or technique are you using for the trace? What do you want out of it? If you know it's a particular SP why not try understanding the code....sorry got into trainer mode there.

    Please give details of what you have tried already.

    Fitz

  • You should look at SQL Trace in Books Online (Books Online is your friend, learn to read it and used it).

    Depending on what you are trying to accomplish, the event class you will probably want to capture is SP:StmtCompleted. Since it is only one stored procedure, you would filter ObjectName using the name of your stored procedure.

  • This particular OP give me the feel that he/she thinks that he/she owns us. :angry:

    Read a lot of posts from him/her. Its the same everywhere.

    No Offense Riya Dave. Just what you made me feel. :crying::-D

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • If you're working in 2008 or better in SQL Server, I strongly recommend you use Extended Events. That's the least intrusive way to gather metrics. There's no GUI available unless you're running on SQL Server 2012, but the scripts are pretty easy to understand and there are commands to load the data gathered into a table in a database for querying later. You can filter these much better than using trace (my 2nd choice) so you'll get cleaner data. Here's the introduction in Books Online (this is the 2008 version). Here's a getting started article in MSDN, from Jonathan Kehayias.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 7 posts - 1 through 6 (of 6 total)

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