-- EXEC MIG_TEXTS_Sp
CREATE OR ALTER PROCEDURE MIG_TEXTS_Sp
AS
BEGIN

	DELETE FROM MIG_TEXTS

	INSERT INTO MIG_TEXTS (TABLE_NAME, FIELD_NAME, ZZ_ID, TEXT_ID, TEXT)
	SELECT 'pdcad102','extd', ZZ_ID,  0, EXTRA_DATA FROM MAPPING_RULES
	UNION
	SELECT 'pdpdm111','text', ZZ_ID,  0, [TEXT] FROM ITEM_ROUTING 
	UNION
	SELECT 'pdwfl114','cmnt', ZZ_ID,  0, TEXT_COMMENT FROM EO_EXT_CMNT
	UNION
	SELECT 'pdwfl100','impa', ZZ_ID,  0, IMPACT_ANALYSIS FROM EO
	UNION
	SELECT 'pdwfl100','rsch', ZZ_ID,  0, REASON_FOR_CHANGE FROM EO
	UNION
	SELECT 'pdwfl100','rmrk', ZZ_ID,  0, REMARKS FROM EO
	UNION
	SELECT 'pdwfl126','msgt', ZZ_ID,  0, [MESSAGE] FROM EO_DUE_EVENTS
	UNION
	SELECT 'pdwfl133','mess', ZZ_ID,  0, MESS FROM MIG_EO_DISTRIBUTION_PRM
	UNION
	SELECT 'pdwfl207','msgt', ZZ_ID,  0, [MESSAGE] FROM RT_DUE_EVENTS
	UNION
	SELECT 'pdwfl233','mess', ZZ_ID,  0, MESS FROM MIG_ROUTE_DISTRIBUTION_PRM

END

