-- EXEC MIG_EO_HISTORY_USERS_Sp
CREATE OR ALTER PROC MIG_EO_HISTORY_USERS_Sp
AS
BEGIN

	DELETE FROM MIG_EO_HISTORY_USERS
	INSERT INTO MIG_EO_HISTORY_USERS

	SELECT	ZZ_ID, 
			USR.LN_USER as USR_NME, 
			RTO.LN_USER as REJECT_TO
	FROM EO_HISTORY HIS
	LEFT JOIN MIG_USERS USR	ON USR.USER_NAME =  HIS.[USER_NAME]
	LEFT JOIN MIG_USERS RTO	ON RTO.USER_NAME =  HIS.REJECT_TO

END
