Solved

Execute Stroed Procedure

Posted on 2011-02-21
3
203 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

     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 …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

772 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