CREATE PROCEDURE MIG_DATASET_USERS_Sp
AS 
BEGIN
	
	DELETE FROM MIG_DATASET_USERS

	INSERT INTO MIG_DATASET_USERS

	SELECT	ZZ_ID, 
			AUT.LN_USER as AUTHOR,  
			LCK.LN_USER as LOCKED_BY
	FROM DATASET FIL
	LEFT JOIN MIG_USERS AUT	ON AUT.USER_NAME =  FIL.AUTHOR
	LEFT JOIN MIG_USERS LCK	ON LCK.USER_NAME = FIL.LOCKED_BY

END


