[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
Unofficial UNIT-e Forum • SPR_WithdrawalReasonMapping
Page 1 of 1

SPR_WithdrawalReasonMapping

Posted: Fri Mar 03, 2017 12:06 am
by robinwilson16
Maps detailed college withdrawal reasons back to the ILR withdrawal reasons

Code: Select all

CREATE PROCEDURE [dbo].[SPR_WithdrawalReasonMapping] 

AS
BEGIN

SET NOCOUNT ON;

UPDATE ISR
SET 
	ei_ilrh31 = WDR.vc_national,
	ei_ilrh16 = 
		CASE
			WHEN ME.e_enrolprogaction = 'L1' THEN '1'
			ELSE '2'
		END,
	ei_ilrwithdrawalreason = WDR.vc_national2

FROM
	ulive.dbo.capd_moduleenrolment ME
INNER JOIN ulive.dbo.capd_enrolmentisr ISR
	ON ISR.ei_id = ME.e_id
INNER JOIN ulive.dbo.caps_valid_codes WDR
	ON WDR.vc_code = ME.e_enrolprogaction
	AND WDR.vc_domain = 'enrolprogaction'
END