need to return @SQLCode(code showing if successful or not) and
@ErrMsg(and the message returned). I am clueless on this.
I wrote this procedure:
Expand|Select|Wrap|Line Numbers
- ALTER PROCEDURE [dbo].[usp_AcceptLeaveBalance]
- @Emp_SSN int,
- @Annual_Forward decimal(10,2),
- @Sick_Forward decimal(10,2),
- @Family_Forward decimal(10,2),
- @Other_Forward decimal(10,2)
- AS
- UPDATE OT_MAIN
- SET
- EmpAnnual_Forward = IsNull(@Annual_Forward, EmpAnnual_Forward),
- EmpSick_Forward = IsNull(@Sick_Forward, EmpSick_Forward),
- EmpFamily_Forward = IsNull(@Family_Forward, EmpFamily_Forward),
- EmpOther_Forward = IsNull(@Other_Forward, EmpOther_Forward)
- WHERE
- Emp_SSN=@Emp_SSN
Expand|Select|Wrap|Line Numbers
- exec usp_AcceptLeaveBalance 123456789, 10, 10, null, 10
know it shouldn't be successful because 123456789 does not refer to
any SSN.
So i am just inquring how to do the error handling and secondly I am
guessing I need to check to see if the ssn exists first.
Any suggestions or help.
I greatly appreciate it, and thanks for the help.