Execute Stroed Procedure

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?
jordanhelenAsked:
Who is Participating?
 
raulggonzalezConnect With a Mentor Commented:
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
 
raulggonzalezCommented:
Ups, and to see the values...


SELECT @result1, @result2


Cheers
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.