/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_DELIVERNOTICE_F' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_SM_DELIVERNOTICE_F ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDER_F' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_SM_SALORDER_F ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_XSALORDER_F' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_SM_XSALORDER_F ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_RETURNAPPLY_F' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_SM_RETURNAPPLY_F ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_DELIVERNOTICEENTRY' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_SM_DELIVERNOTICEENTRY ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_RETURNAPPLYENTRY' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_SM_RETURNAPPLYENTRY ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_SM_SALORDERENTRY ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_XSALORDERENTRY' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_SM_XSALORDERENTRY ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );

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