/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLS_DETAIL_ENTRY' AND KSQL_COL_NAME ='FWCTIMECONSUMING') 
 ALTER TABLE T_MRP_PLS_DETAIL_ENTRY ADD (FWCTIMECONSUMING DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FDATAVERSIONID') 
 ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FDATAVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FISRUNNING') 
 ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FISRUNNING CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FDATAVERSIONLOG') 
 ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FDATAVERSIONLOG NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FDATAVERSIONSTATUS') 
 ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FDATAVERSIONSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
