How can I see the value of parameters in stored procedure?

  • Hello

    when I'm executing my stored procedure, one of my output didn't back any value.

    How can I see the value of parameters in my stored procedure when I'm running it.(I want to do something like Press F10 in programming)

    in fact I want to trace my stored procedure

  • Did you try to use the Debug mode in SSMS?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Yes I try it but I think I didn't do it correct, I don't know how can I debug it?

  • Remember that I can't look over your shoulder so I can't tell you what you might have done wrong.

    Based on your very vague statement there's very little I can do.

    My only advice: use google to find a walk-through editorial. I'm sure those are out there....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • If you want to see the value of a variable at a certain point during execution and can't get debug to work, the PRINT (http://technet.microsoft.com/en-us/library/ms176047%28v=sql.100%29.aspx) and SELECT (http://technet.microsoft.com/en-us/library/ms189499%28v=sql.100%29.aspx) statements work fine.

  • You can trace each statement within the procedure by using Extended Events. You can set up to capture each statement start and end. That will give you precise information on each step, how long it took, everything. Just know that you need to set up your filters on the events appropriately or you'll see all the statements for all the procedures, which you don't want. This will get you started.

    "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 6 posts - 1 through 5 (of 5 total)

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