CREATE PROCEDURE [MIG_UPDATE_PROJ_CONFIG_PREFERENCES_Sp]
(
	 @InputProjectID NVARCHAR(MAX)
)
AS BEGIN
	-- The purpose of this stored procedure is to update in [MIG_PROJ_CONFIG] table.

	DECLARE @c101 int 
	DECLARE @c102 int 
	DECLARE @c103 int 
	DECLARE @c104 int 
	DECLARE @c105 int 
	DECLARE @c106 int 
	DECLARE @c107 int 
	DECLARE @c108 int 
	DECLARE @c109 int 
	DECLARE @c110 int 
	DECLARE @c111 int 
	DECLARE @c112 int 
	DECLARE @c113 int 
	DECLARE @c114 int 
	DECLARE @c115 int 
	DECLARE @c116 int 
	DECLARE @c117 int 
	DECLARE @c119 int 
	DECLARE @c120 int 
	DECLARE @c121 int 
	DECLARE @c122 int 
	DECLARE @c123 int 
	DECLARE @c124 int 
	DECLARE @c125 int 
	DECLARE @c201 int 
	DECLARE @c202 int 
	DECLARE @c203 int 
	DECLARE @c204 int 
	DECLARE @c205 int 
	DECLARE @c206 int 
	DECLARE @c207 int 
	DECLARE @c208 int 
	DECLARE @c209 int 
	DECLARE @c210 int 
	DECLARE @c211 int 
	DECLARE @c212 int 
	DECLARE @c213 int 
	DECLARE @c214 int 
	DECLARE @c215 int 
	DECLARE @c216 int 
	DECLARE @c217 int 
	DECLARE @c218 int 
	DECLARE @c219 int 
	DECLARE @c220 int 
	DECLARE @c221 int 
	DECLARE @c223 int 
	DECLARE @c224 int 
	DECLARE @c225 int 
	DECLARE @c226 int 
	DECLARE @c227 int 
	DECLARE @c228 int 
	DECLARE @c229 int 
	DECLARE @c230 int 
	DECLARE @c231 int 
	DECLARE @c301 int 
	DECLARE @c302 int 
	DECLARE @c303 int 
	DECLARE @c304 int 
	DECLARE @c305 int 
	DECLARE @c306 int 
	DECLARE @c307 int 
	DECLARE @c308 int 
	DECLARE @c309 int 
	DECLARE @c310 int 
	DECLARE @c311 int 
	DECLARE @c313 int 
	DECLARE @c314 int 
	DECLARE @c401 int 
	DECLARE @c402 int 
	DECLARE @c403 int 
	DECLARE @c404 int 
	DECLARE @c405 int 
	DECLARE @c406 int 
	DECLARE @c407 int 
	DECLARE @c408 int 
	DECLARE @c409 int 
	DECLARE @c410 int 
	DECLARE @c411 int 
	
	/*
	SELECT 
		MIG_TARGET_TABLE_FIELD.NAME,
		MIG_TARGET_TABLE_FIELD.DESCRIPTION,
		CASE 
			WHEN MIG_PROJ_CONFIG_PREF_NAMES_MAPPING.LegacyPrefName IS NULL OR MIG_PROJ_CONFIG_PREF_NAMES_MAPPING.LegacyPrefName = '' THEN
				'SET @' +
						SUBSTRING(MIG_TARGET_TABLE_FIELD.NAME, CHARINDEX('.', MIG_TARGET_TABLE_FIELD.NAME) + 1, 100) +
						' = ' + 
						'''' + MIG_TARGET_TABLE_FIELD.DEFAULT_VALUE + '''' 
			ELSE
				'SET @' +
						SUBSTRING(MIG_TARGET_TABLE_FIELD.NAME, CHARINDEX('.', MIG_TARGET_TABLE_FIELD.NAME) + 1, 100) +
						' = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, ' +
						'''' + SUBSTRING(MIG_TARGET_TABLE_FIELD.NAME, CHARINDEX('.', MIG_TARGET_TABLE_FIELD.NAME) + 1, 100) + ''', ' +
						'''' + MIG_TARGET_TABLE_FIELD.DOMAIN + ''',' +
						'''' + MIG_TARGET_DOMAINS.DATA_TYPE + ''',' +
						'''' + MIG_PROJ_CONFIG_PREF_NAMES_MAPPING.Class + ''',' +
						'''' + MIG_PROJ_CONFIG_PREF_NAMES_MAPPING.LegacyPrefName + ''',' +
						'''' + MIG_TARGET_TABLE_FIELD.DEFAULT_VALUE + '''' +
						')'
			END +
			' -- ' + MIG_TARGET_TABLE_FIELD.DESCRIPTION + ' (Domain = ' + MIG_TARGET_TABLE_FIELD.DOMAIN + ', Type = ' + MIG_TARGET_DOMAINS.DATA_TYPE +')'
		AS "EXPRESSION_1",
		'' +
				SUBSTRING(MIG_TARGET_TABLE_FIELD.NAME, CHARINDEX('.', MIG_TARGET_TABLE_FIELD.NAME) + 1, 100) +
				' = @' + SUBSTRING(MIG_TARGET_TABLE_FIELD.NAME, CHARINDEX('.', MIG_TARGET_TABLE_FIELD.NAME) + 1, 100) + ', '
		AS "EXPRESSION_2",
		MIG_TARGET_TABLE_FIELD.DOMAIN,
		MIG_TARGET_DOMAINS.DATA_TYPE,
		MIG_PROJ_CONFIG_PREF_NAMES_MAPPING.LegacyPrefName,
		MIG_TARGET_TABLE_FIELD.DEFAULT_VALUE
	FROM MIG_TARGET_TABLE_FIELD
	JOIN MIG_TARGET_DOMAINS
	  ON MIG_TARGET_DOMAINS.NAME = MIG_TARGET_TABLE_FIELD.DOMAIN
	LEFT JOIN MIG_PROJ_CONFIG_PREF_NAMES_MAPPING
	  ON ('pdadm301.' + MIG_PROJ_CONFIG_PREF_NAMES_MAPPING.Field) = MIG_TARGET_TABLE_FIELD.NAME
	WHERE TABLE_NAME = 'pdadm301'
	ORDER BY MIG_TARGET_TABLE_FIELD.TABLE_NAME, MIG_TARGET_TABLE_FIELD.NAME
	*/

	SET @c101 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c101', 'pdvlt.ckin','E','ITEM','CHILD_LINKS_IN','10') -- Check-In Item Child Items (Domain = pdvlt.ckin, Type = E)
	SET @c102 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c102', 'pdvlt.cout','E','ITEM','CHILD_LINKS','20') -- Check-Out Item Child Items (Domain = pdvlt.cout, Type = E)
	SET @c103 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c103', 'pdvlt.ckin','E','ITEM','PARENT_LINKS_IN','10') -- Check-In Item Parent Items (Domain = pdvlt.ckin, Type = E)
	SET @c104 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c104', 'pdvlt.cout','E','ITEM','PARENT_LINKS','20') -- Check-Out Item Parent Items (Domain = pdvlt.cout, Type = E)
	SET @c105 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c105', 'pdvlt.ckin','E','ITEM','RELATED_DOCS_IN','20') -- Check-In Item Related Documents (Domain = pdvlt.ckin, Type = E)
	SET @c106 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c106', 'pdvlt.cout','E','ITEM','RELATED_DOCS','30') -- Check-Out Item Related Documents (Domain = pdvlt.cout, Type = E)
	SET @c107 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c107', 'pdvlt.ckin','E','ITEM','RELATED_DRAWING_IN','20') -- Check-In Item Related Drawings (Domain = pdvlt.ckin, Type = E)
	SET @c108 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c108', 'pdvlt.cout','E','ITEM','RELATED_DRAWING','30') -- Check-Out Item Related Drawings (Domain = pdvlt.cout, Type = E)
	SET @c109 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c109', 'pdvlt.ckin','E','ITEM','RELATED_FLDR_IN','10') -- Check-In Item Related Folders (Domain = pdvlt.ckin, Type = E)
	SET @c110 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c110', 'pdvlt.cout','E','ITEM','RELATED_FLDR','20') -- Check-Out Item Related Folders (Domain = pdvlt.cout, Type = E)
	SET @c111 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c111', 'pdvlt.ckin','E','ITEM','RELATED_MTRL_IN','10') -- Check-In Item Related Materials (Domain = pdvlt.ckin, Type = E)
	SET @c112 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c112', 'pdvlt.cout','E','ITEM','RELATED_MTRL','20') -- Check-Out Item Related Materials (Domain = pdvlt.cout, Type = E)
	SET @c113 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c113', 'pdvlt.ckin','E','ITEM','RELATED_NOTES_IN','10') -- Check-In Item Related Notes (Domain = pdvlt.ckin, Type = E)
	SET @c114 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c114', 'pdvlt.cout','E','ITEM','RELATED_NOTES','20') -- Check-Out Item Related Notes (Domain = pdvlt.cout, Type = E)
	SET @c115 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c115', 'pdvlt.ckin','E','ITEM','RELATED_SUB_IN','10') -- Check-In Item Related Subcontractors (Domain = pdvlt.ckin, Type = E)
	SET @c116 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c116', 'pdvlt.cout','E','ITEM','RELATED_SUB','20') -- Check-Out Item Related Subcontractors (Domain = pdvlt.cout, Type = E)
	SET @c117 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c117', 'pdyesno','E','ITEM','ITM_SON_STATUS','2') -- Item Child Status (Domain = pdyesno, Type = E)
	SET @c119 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c119', 'pdvlt.ckin','E','ITEM','RELATED_EOS_IN','10') -- Check-In Item Related Business Processes (Domain = pdvlt.ckin, Type = E)
	SET @c120 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c120', 'pdvlt.cout','E','ITEM','RELATED_EOS','20') -- Check-Out Item Related Business Processes (Domain = pdvlt.cout, Type = E)
	SET @c121 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c121', 'pdvlt.ckin','E','ITEM','RELATED_EUS_IN','10') -- Check-In Item Related Business Process Route Step (Domain = pdvlt.ckin, Type = E)
	SET @c122 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c122', 'pdvlt.cout','E','ITEM','RELATED_EUS','20') -- Check-Out Item Related Businsess Process Route Step Item (Domain = pdvlt.cout, Type = E)
	SET @c123 = '20' -- Check-Out Configuration for Local Alternative Items (Domain = pdvlt.cout, Type = E)
	SET @c124 = '20' -- Check-Out Configuration for Item Category Data (Domain = pdvlt.cout, Type = E)
	SET @c125 = '20' -- Check-Out Configuration for Item Reference Designators (Domain = pdvlt.cout, Type = E)
	SET @c201 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c201', 'pdvlt.ckin','E','DOC','CHILD_LINKS_IN','20') -- Check-In Document Child Documents (Domain = pdvlt.ckin, Type = E)
	SET @c202 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c202', 'pdvlt.cout','E','DOC','CHILD_LINKS','20') -- Check-Out Document Child Documents (Domain = pdvlt.cout, Type = E)
	SET @c203 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c203', 'pdvlt.ckin','E','DOC','LOGICAL_LINK_IN','10') -- Check-In Document Reference Documents (Domain = pdvlt.ckin, Type = E)
	SET @c204 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c204', 'pdvlt.cout','E','DOC','LOGICAL_LINK','20') -- Check-Out Document Reference Documents (Domain = pdvlt.cout, Type = E)
	SET @c205 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c205', 'pdvlt.ckin','E','DOC','PARENT_LINKS_IN','10') -- Check-In Document Parent Documents (Domain = pdvlt.ckin, Type = E)
	SET @c206 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c206', 'pdvlt.cout','E','DOC','PARENT_LINKS','20') -- Check-Out Document Parent Documents (Domain = pdvlt.cout, Type = E)
	SET @c207 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c207', 'pdvlt.ckin','E','DOC','RELATED_FILE_IN','20') -- Check-In Document Related Files (Domain = pdvlt.ckin, Type = E)
	SET @c208 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c208', 'pdvlt.cout','E','DOC','RELATED_FILE','30') -- Check-Out Document Related Files (Domain = pdvlt.cout, Type = E)
	SET @c209 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c209', 'pdvlt.ckin','E','DOC','RELATED_FLDR_IN','10') -- Check-In Document Related Folders (Domain = pdvlt.ckin, Type = E)
	SET @c210 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c210', 'pdvlt.cout','E','DOC','RELATED_FLDR','20') -- Check-Out Document Related Folders (Domain = pdvlt.cout, Type = E)
	SET @c211 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c211', 'pdvlt.ckin','E','DOC','RELATED_ITEM_IN','20') -- Check-In Document Related Items (Domain = pdvlt.ckin, Type = E)
	SET @c212 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c212', 'pdvlt.cout','E','DOC','RELATED_ITEM','30') -- Check-Out Document Related Items (Domain = pdvlt.cout, Type = E)
	SET @c213 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c213', 'pdvlt.ckin','E','DOC','RELATED_MODEL_IN','10') -- Check-In Document Related Models (Domain = pdvlt.ckin, Type = E)
	SET @c214 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c214', 'pdvlt.cout','E','DOC','RELATED_MODEL','20') -- Check-Out Document Related Models (Domain = pdvlt.cout, Type = E)
	SET @c215 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c215', 'pdvlt.ckin','E','DOC','RELATED_NOTES_IN','10') -- Check-In Document Related Notes (Domain = pdvlt.ckin, Type = E)
	SET @c216 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c216', 'pdvlt.cout','E','DOC','RELATED_NOTES','20') -- Check-Out Document Related Notes (Domain = pdvlt.cout, Type = E)
	SET @c217 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c217', 'pdvlt.ckin','E','DOC','RELATED_REF_DRIVER_IN','10') -- Check-In Document Driver Documents (Domain = pdvlt.ckin, Type = E)
	SET @c218 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c218', 'pdvlt.cout','E','DOC','RELATED_REF_DRIVER','20') -- Check-Out Document Driver Documents (Domain = pdvlt.cout, Type = E)
	SET @c219 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c219', 'pdvlt.ckin','E','DOC','RELATED_REF_IMPACTED_IN','10') -- Check-In Document Impacted  Documents (Domain = pdvlt.ckin, Type = E)
	SET @c220 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c220', 'pdvlt.cout','E','DOC','RELATED_REF_IMPACTED','20') -- Check-Out Document Impacted  Documents (Domain = pdvlt.cout, Type = E)
	SET @c221 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c221', 'pdyesno','E','DOC','DOC_SON_STATUS','2') -- Document Child Status (Domain = pdyesno, Type = E)
	SET @c223 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c223', 'pdvlt.ckin','E','DOC','RELATED_MTRL_IN','10') -- Check-In Document Related Materials (Domain = pdvlt.ckin, Type = E)
	SET @c224 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c224', 'pdvlt.cout','E','DOC','RELATED_MTRL','20') -- Check-Out Document Related Materials (Domain = pdvlt.cout, Type = E)
	SET @c225 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c225', 'pdvlt.ckin','E','DOC','RELATED_EOS_IN','10') -- Check-In Document Related Business Processes (Domain = pdvlt.ckin, Type = E)
	SET @c226 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c226', 'pdvlt.cout','E','DOC','RELATED_EOS','20') -- Check-Out Document Related Business Processes (Domain = pdvlt.cout, Type = E)
	SET @c227 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c227', 'pdvlt.ckin','E','DOC','RELATED_EUS_IN','10') -- Check-In Document Related Business Process Route Step (Domain = pdvlt.ckin, Type = E)
	SET @c228 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c228', 'pdvlt.cout','E','DOC','RELATED_EUS','20') -- Check-Out Document Related Business Process Route Step (Domain = pdvlt.cout, Type = E)
	SET @c229 = '20' -- Check-Out Configuration for Document Category Data (Domain = pdvlt.cout, Type = E)
	SET @c230 = '20' -- Check-Out Configuration for Document TAA (Domain = pdvlt.cout, Type = E)
	SET @c231 = '20' -- Check-Out Configuration for Document Distribution Lists (Domain = pdvlt.cout, Type = E)
	SET @c301 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c301', 'pdvlt.ckin','E','FOLDER','CHILD_LINKS_IN','10') -- Check-In Folder Child Folders (Domain = pdvlt.ckin, Type = E)
	SET @c302 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c302', 'pdvlt.cout','E','FOLDER','CHILD_LINKS','20') -- Check-Out Folder Child Folders (Domain = pdvlt.cout, Type = E)
	SET @c303 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c303', 'pdvlt.ckin','E','FOLDER','LOGICAL_LINK_IN','10') -- Check-In Folder Reference Folders (Domain = pdvlt.ckin, Type = E)
	SET @c304 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c304', 'pdvlt.cout','E','FOLDER','LOGICAL_LINK','20') -- Check-Out Folder Reference Folders (Domain = pdvlt.cout, Type = E)
	SET @c305 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c305', 'pdvlt.ckin','E','FOLDER','PARENT_LINKS_IN','10') -- Check-In Folder Parent Folders (Domain = pdvlt.ckin, Type = E)
	SET @c306 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c306', 'pdvlt.cout','E','FOLDER','PARENT_LINKS','20') -- Check-Out Folder Parent Folders (Domain = pdvlt.cout, Type = E)
	SET @c307 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c307', 'pdvlt.ckin','E','FOLDER','RELATED_DOCS_IN','10') -- Check-In Folder Related Documents (Domain = pdvlt.ckin, Type = E)
	SET @c308 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c308', 'pdvlt.cout','E','FOLDER','RELATED_DOCS','20') -- Check-Out Folder Related Documents (Domain = pdvlt.cout, Type = E)
	SET @c309 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c309', 'pdvlt.ckin','E','FOLDER','RELATED_ITEM_IN','10') -- Check-In Folder Related Items (Domain = pdvlt.ckin, Type = E)
	SET @c310 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c310', 'pdvlt.cout','E','FOLDER','RELATED_ITEM','20') -- Check-Out Folder Related Items (Domain = pdvlt.cout, Type = E)
	SET @c311 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c311', 'pdyesno','E','FOLDER','FLD_SON_STATUS','2') -- Folder Child Status (Domain = pdyesno, Type = E)
	SET @c313 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c313', 'pdvlt.ckin','E','FOLDER','RELATED_MTRL_IN','10') -- Check-In Folder Related Materials (Domain = pdvlt.ckin, Type = E)
	SET @c314 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c314', 'pdvlt.cout','E','FOLDER','RELATED_MTRL','20') -- Check-Out Folder Related Materials (Domain = pdvlt.cout, Type = E)
	SET @c401 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c401', 'pdvlt.ckin','E','MATERIAL','RELATED_ITEM_IN','10') -- Check-In Material Related Items (Domain = pdvlt.ckin, Type = E)
	SET @c402 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c402', 'pdvlt.cout','E','MATERIAL','RELATED_ITEM','20') -- Check-Out Material Related Items (Domain = pdvlt.cout, Type = E)
	SET @c403 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c403', 'pdvlt.ckin','E','MATERIAL','RELATED_DOCS_IN','10') -- Check-In Material Related Documents (Domain = pdvlt.ckin, Type = E)
	SET @c404 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c404', 'pdvlt.cout','E','MATERIAL','RELATED_DOCS','20') -- Check-Out Material Related Documents (Domain = pdvlt.cout, Type = E)
	SET @c405 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c405', 'pdvlt.ckin','E','MATERIAL','RELATED_FLDR_IN','10') -- Check-In Material Related Folders (Domain = pdvlt.ckin, Type = E)
	SET @c406 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c406', 'pdvlt.cout','E','MATERIAL','RELATED_FLDR','20') -- Check-Out Material Related Folders (Domain = pdvlt.cout, Type = E)
	SET @c407 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c407', 'pdvlt.ckin','E','MATERIAL','RELATED_EOS_IN','10') -- Check-In Material Related Business Processes (Domain = pdvlt.ckin, Type = E)
	SET @c408 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c408', 'pdvlt.cout','E','MATERIAL','RELATED_EOS','20') -- Check-Out Material Related Business Processes (Domain = pdvlt.cout, Type = E)
	SET @c409 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c409', 'pdvlt.ckin','E','MATERIAL','RELATED_EUS_IN','10') -- Check-In Material Related Business Process Route Step (Domain = pdvlt.ckin, Type = E)
	SET @c410 = dbo.MIG_GET_PROJ_PREF_VALUE_Fn(@InputProjectID, 'c410', 'pdvlt.cout','E','MATERIAL','RELATED_EUS','20') -- Check-Out Material Related Business Process Route Step (Domain = pdvlt.cout, Type = E)
	SET @c411 = '20' -- Check-Out Configuration for Material Category Data (Domain = pdvlt.cout, Type = E)

	
	UPDATE MIG_PROJ_CONFIG
	SET			 
		c101 = @c101, 
		c102 = @c102, 
		c103 = @c103, 
		c104 = @c104, 
		c105 = @c105, 
		c106 = @c106, 
		c107 = @c107, 
		c108 = @c108, 
		c109 = @c109, 
		c110 = @c110, 
		c111 = @c111, 
		c112 = @c112, 
		c113 = @c113, 
		c114 = @c114, 
		c115 = @c115, 
		c116 = @c116, 
		c117 = @c117, 
		c119 = @c119, 
		c120 = @c120, 
		c121 = @c121, 
		c122 = @c122, 
		c123 = @c123, 
		c124 = @c124, 
		c125 = @c125, 
		c201 = @c201, 
		c202 = @c202, 
		c203 = @c203, 
		c204 = @c204, 
		c205 = @c205, 
		c206 = @c206, 
		c207 = @c207, 
		c208 = @c208, 
		c209 = @c209, 
		c210 = @c210, 
		c211 = @c211, 
		c212 = @c212, 
		c213 = @c213, 
		c214 = @c214, 
		c215 = @c215, 
		c216 = @c216, 
		c217 = @c217, 
		c218 = @c218, 
		c219 = @c219, 
		c220 = @c220, 
		c221 = @c221, 
		c223 = @c223, 
		c224 = @c224, 
		c225 = @c225, 
		c226 = @c226, 
		c227 = @c227, 
		c228 = @c228, 
		c229 = @c229, 
		c230 = @c230, 
		c231 = @c231, 
		c301 = @c301, 
		c302 = @c302, 
		c303 = @c303, 
		c304 = @c304, 
		c305 = @c305, 
		c306 = @c306, 
		c307 = @c307, 
		c308 = @c308, 
		c309 = @c309, 
		c310 = @c310, 
		c311 = @c311, 
		c313 = @c313, 
		c314 = @c314, 
		c401 = @c401, 
		c402 = @c402, 
		c403 = @c403, 
		c404 = @c404, 
		c405 = @c405, 
		c406 = @c406, 
		c407 = @c407, 
		c408 = @c408, 
		c409 = @c409, 
		c410 = @c410, 
		c411 = @c411
	WHERE PROJ = @InputProjectID
END


