[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Execute Stroed Procedure

Posted on 2011-02-21
3
Medium Priority
?
210 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 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

830 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