
CREATE PROCEDURE MIG_SYS_AND_USER_PROPS_Sp
AS
BEGIN

	DELETE FROM [MIG_SYS_AND_USER_PROPS]

	INSERT INTO [MIG_SYS_AND_USER_PROPS]

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

SELECT '' as [USER_ID],
		PROP_ID,
		[APP_NAME],
		CATEGORY,
		PROP_NAME,
		PROP_VALUE,
		PROP_GUI_TYPE,
		ALLOWED_USER,
		UPDATED_ON
FROM SYS_PROPS  
UNION
SELECT  [USER_ID],
		PROP_ID,
		[APP_NAME],
		CATEGORY,
		PROP_NAME,
		PROP_VALUE,
		PROP_GUI_TYPE,
		ALLOWED_USER,
		UPDATED_ON
FROM USER_PROPS 

WHERE PROP_GUI_TYPE NOT IN (0, 1, 2 ,3 ,4, 5) 
ORDER BY PROP_ID

END

