Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- if we have a branch for the applicant
- -- update the relevant Ultra-Staff tables
- DECLARE @targetid INT
- DECLARE @branchcode VARCHAR(50)
- IF @appl_id_us > 0
- BEGIN
- SELECT @targetid = @appl_id_us
- END
- ELSE
- BEGIN
- SELECT @targetid = @new_applicant_id
- END
- IF EXISTS(SELECT * FROM dbo.ASEWEB_APPL_BRANCH WHERE appl_id = @appl_id)
- BEGIN
- SELECT @branchcode = (SELECT branch_code_us FROM dbo.ASEWEB_APPL_BRANCH WHERE appl_id = @appl_id)
- IF UPPER(@branchcode) <> 'NOT SELECTED'
- BEGIN
- UPDATE t_applicant_details SET DET_OFFICE = CAST(@branchcode AS INT) WHERE APPL_ID = @targetid
- UPDATE dbo.uboT_PR_EMPLOYEE SET Branch_Number = CAST(@branchcode AS INT) WHERE EmployeeNumber = @targetid
- UPDATE dbo.ASEWEB_APPL_BRANCH SET appl_id_us = @targetid WHERE appl_id = @appl_id
- END
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement