-- MRP计算明细表新增需求弹性维度ID，需求弹性维度值，供应弹性维度ID，供应弹性维度值
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FSUPFLEXMETRICID') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FSUPFLEXMETRICID NVARCHAR(2000) DEFAULT ' ' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FREQFLEXMETRICID') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FREQFLEXMETRICID NVARCHAR(2000) DEFAULT ' ' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FSUPFLEXMETRICVAL') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FSUPFLEXMETRICVAL NVARCHAR(2000) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FREQFLEXMETRICVAL') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FREQFLEXMETRICVAL NVARCHAR(2000) DEFAULT ' ' NOT NULL );
 
 


