Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Execute Stroed Procedure

Posted on 2011-02-21
3
Medium Priority
?
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
raulggonzalez earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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