Hi sir,
I did one store procedure which having one error parameter. It is created successfully, if execute that stored procedure ,it show error
"Msg 201, Level 16, State 4, Procedure spuserdetail, Line 0
Procedure or Function 'spuserdetail' expects parameter '@Error', which was not supplied." I attached the stored procedure below. Kindly give me the solution for this problem.
Procedure:
******************
create PROCEDURE [dbo].[spuserdetail]
@empid int,
@empname varchar(50),
@empsal varchar(50),
@Error VARCHAR(100) out
AS
BEGIN
SET NOCOUNT ON;
-- To Check Employee Name is exits or not
IF NOT EXISTS(SELECT * FROM emp WHERE ename=@empname)
BEGIN
insert into emp(eid,ename,esalary) values (@empid,@empname,@empsal)
SET @Error=@empname+' Registered Successfully'
END
ELSE
BEGIN
SET @ERROR=@empname + ' Already Exists'
END
END
Calling the procedure:
************************
exec [spuserdetail] 3,'Aravind',12000
Error while executing the procedure:
*************************************
Msg 201, Level 16, State 4, Procedure spuserdetail, Line 0
Procedure or Function 'spuserdetail' expects parameter '@Error', which was not supplied.
With regards,
J.Prabu.
[Email:prbspark@gmail.com]