 --BOM展开单据新增组件物料属性字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fcomboxmaterialattr') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fcomboxmaterialattr NVARCHAR(30) DEFAULT ' ' NOT NULL );
 
 --BOM展开单据新增组件生产组织字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmoduleproorg') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmoduleproorg BIGINT DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增组件供货组织字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmodulesupplyorg') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmodulesupplyorg BIGINT DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增BOM版本字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fbomversion') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fbomversion NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
 --BOM展开单据新增组件BOM版本字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmoduleversion') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmoduleversion NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
 --BOM展开单据新增ECN版本字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fecnversion') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fecnversion BIGINT DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增组件ECN版本字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmoduleecnversion') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmoduleecnversion BIGINT DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增组件类型字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmoduletype') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmoduletype NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
 --BOM展开单据新增组件用量:分子字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmodulenumerator') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmodulenumerator DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增组件用量:分母字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmoduledenominator') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmoduledenominator DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增组件固定消耗字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmoduleloss') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmoduleloss DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增组件变动损耗率字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmodulewaste') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmodulewaste DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
 --BOM展开单据新增生产偏置期字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_bomexpandentry' AND KSQL_COL_NAME ='fmanuperiod') 
 ALTER TABLE t_mrp_bomexpandentry ADD (fmanuperiod BIGINT DEFAULT 0 NOT NULL );
 
 --需求单据新增ECN版本字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_mrp_demandbillentry' AND KSQL_COL_NAME ='fecnversion') 
 ALTER TABLE t_mrp_demandbillentry ADD (fecnversion BIGINT DEFAULT 0 NOT NULL );
 
 