Solved

Execute Stroed Procedure

Posted on 2011-02-21
3
201 Views
Last Modified: 2012-05-11
I have a stored procedure with two parameters, @categoryID and @NameID
How do I use EXEC to execute the procedure to get the result of the parameters?
0
Comment
Question by:jordanhelen
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
raulggonzalez earned 500 total points
ID: 34944961
Hi, more or less like this


DECLARE      @result1 int,
            @result2 int

EXEC      [dbo].[YourProcedure]
            @result1 = @param1 OUTPUT,
            @result2 = @param2 OUTPUT



depends on the definition of your SP, but to get the value of OUTPUT params, should be enough so.


Cheers
0
 
LVL 8

Expert Comment

by:raulggonzalez
ID: 34945281
Ups, and to see the values...


SELECT @result1, @result2


Cheers
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 34948831
At the end of your Procedure, include a simple SELECT stament like this:

SELECT @categoryID, @NameID

Once done, whenever you execute your procedure, you would be able to see those two values printed at the result screen.
Else, the above method would do good..
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now