HERE IS MY DB SQL SP
USE [comp.task]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[insert_emp]
@EMP_NUM numeric(18) = null,
@DEBT_NUM numeric(18) =null,
@EMP_NAME varchar(150) =null,
@EMP_P_DATE smalldatetime =null,
@EMP_WORK_DATE smalldatetime =null,
@EMP_SAL NUMERIC(18) =null,
@EMP_DESC VARCHAR(250) =null,
@DEBT_NAME VARCHAR(150) =null
AS
BEGIN
IF NOT EXISTS(SELECT 1 FROM Employee WHERE EMP_NUM = @EMP_NUM )
BEGIN
INSERT INTO DBO.EMPLOYEE ( DEPT_NUM ,EMP_NAME ,EMP_P_DATE ,EMP_WORK_DATE ,EMP_SAL ,EMP_DESC,DEBT_NAME )
VALUES (@DEBT_NUM,@EMP_NAME,@EMP_P_DATE,@EMP_WORK_DATE,@EMP_SAL,@EMP_DESC,@DEBT_NAME )
END
ELSE
BEGIN
UPDATE dbo.Employee
SET emp_num =@EMP_NUM ,dept_num =@DEBT_NUM ,emp_name =@EMP_NAME ,emp_p_date =@EMP_P_DATE ,emp_work_date =@EMP_WORK_DATE ,emp_sal =@EMP_SAL ,emp_desc =@EMP_DESC ,debt_name =@DEBT_NAME
WHERE emp_num =@EMP_NUM
END