Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a parameter from a stored procedure
Message
 
 
To
09/03/2010 03:44:19
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01453371
Message ID:
01453389
Views:
49
You can have more than one output parameter in a stored procedure.

>
>I have a stored procedure that performs a record insert, then returns the new record ID to the calling procedure:
>
>ALTER procedure [dbo].[Candidate_Insert_Blank] (@CreatedByID int, @lnCandidateID int output)
>
>as
>begin
>set nocount on;
>insert into Candidate (CreatedByID)
>values (@CreatedByID)
>set @lnCandidateID = scope_identity()
>end
>
>The primary key in the Candidate table is CandidateID, the question is how would I set the return value to an alternative field, i.e. not the primary key?
>
>Also, I presume it's simple enough to return more than one parameter to the calling procedure?
>
>Regards
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform