The easiest way to figure out the syntax of how to call the stored procedure if you are not sure is to right click on the stored proc name in object explorer in SSMS, and select Script Procedure as -> Execute To -> New Query Editor window. That will give you a window with all the right declarations etc. and you just have to set the input variables. So it would be something like this:DECLARE @RC int
DECLARE @id int
DECLARE @stud_f_name2 varchar(64)
SET @id = 11;
EXECUTE @RC = dbo.student_rec3
@id
,@stud_f_name2 OUTPUT
SELECT @stud_f_name2;
One additional thing you may want to do is to add a default value of NULL to the @stud_f_name2 parametercreate procedure student_rec3
(
@id int,
@stud_f_name2 varchar(64) = NULL output
)