/**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_PLANORDER' AND KSQL_COL_NAME ='FSURPLUSDROPQTY') 
 ALTER TABLE T_MRP_PLANORDER ADD (FSURPLUSDROPQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FTHREESTOCK') 
 ALTER TABLE T_MRP_PLANORDER ADD (FTHREESTOCK DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FORDERMOQ') 
 ALTER TABLE T_MRP_PLANORDER ADD (FORDERMOQ DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FDROPTIME') 
 ALTER TABLE T_MRP_PLANORDER ADD (FDROPTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FADVISEDROPTIME') 
 ALTER TABLE T_MRP_PLANORDER ADD (FADVISEDROPTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FCOMMENTREASON') 
 ALTER TABLE T_MRP_PLANORDER ADD (FCOMMENTREASON NVARCHAR(30) DEFAULT ' ' NOT NULL );

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