/**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_SALORDERENTRY_F' AND KSQL_COL_NAME ='FISCONTROLDAY') 
 ALTER TABLE T_SM_SALORDERENTRY_F ADD (FISCONTROLDAY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_F' AND KSQL_COL_NAME ='FDELIVERADVDAYS') 
 ALTER TABLE T_SM_SALORDERENTRY_F ADD (FDELIVERADVDAYS INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_F' AND KSQL_COL_NAME ='FDELIVERDELAYDAYS') 
 ALTER TABLE T_SM_SALORDERENTRY_F ADD (FDELIVERDELAYDAYS INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_XSALORDERENTRY_F' AND KSQL_COL_NAME ='FISCONTROLDAY') 
 ALTER TABLE T_SM_XSALORDERENTRY_F ADD (FISCONTROLDAY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_XSALORDERENTRY_F' AND KSQL_COL_NAME ='FDELIVERADVDAYS') 
 ALTER TABLE T_SM_XSALORDERENTRY_F ADD (FDELIVERADVDAYS INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_XSALORDERENTRY_F' AND KSQL_COL_NAME ='FDELIVERDELAYDAYS') 
 ALTER TABLE T_SM_XSALORDERENTRY_F ADD (FDELIVERDELAYDAYS INT DEFAULT 0 NOT NULL );

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