Information générale
Forum:
Microsoft SQL Server
Titre:
Returning a parameter from a stored procedure
Hi
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement