Main Procedure
CREATE PROCEDURE [dbo].[MAIN_Bld]
(@COID NVARCHAR(5),
@WhoUpd nvarchar(16),
@RsvpID nvarchar(16) OUTPUT)
--' Go do Stuff
-- at end do this
Select @wID as RSVPID
'=======================
In Store Procedure being called is:
Declare @wReturnREC nvarchar(20);
Declare @COID nvarchar(20)='RHAUT'
Declare @WHoUpd nvarchar(20)='AZyyy@TEST'
Declare @wT2 nvarchar(20);
Declare @RsvpID nvarchar(20)
EXECUTE MAIN_Bld @COID,@WHOUPD, @wReturnRec OUTPUT
Set @Wt2= @wReturnRec
Select @Wt2 as Rec
'-------
What I get back is
RSVPID = ZXXXXXX
and
REC = NULL
What I am trying to accomplish is to call MAIN_BLD and set the returning value to
@wReturnRec
Not sure what I am doing wrong