CREATE PROCEDURE MIG_BASE_PROJ_SYS_CONFIG_Sp
AS 
BEGIN
	
	DELETE FROM MIG_BASE_PROJ_SYS_CONFIG

	INSERT INTO [MIG_BASE_PROJ_SYS_CONFIG]

	-- Empty User Means Sys_Props
	-- All Other User Props

	select ZZ_ID, PROJECT_ID, [USER_NAME], CLASS_ID, PREF_NAME, PREF_VALUE, 10 as CONFIG_TYPE, UPDATED_ON from BASE_CONFIG
	UNION
	select ZZ_ID, PROJECT_ID, '' as [USER_NAME], CLASS_ID, PREF_NAME, PREF_VALUE, 15 as CONFIG_TYPE, UPDATED_ON from PROJ_CONFIG
	UNION
	select ZZ_ID, '' as PROJECT_ID, '' as [USER_NAME], CLASS_ID, PREF_NAME, PREF_VALUE, 20 as CONFIG_TYPE,  UPDATED_ON from SYS_CONFIG


END