/**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_R' AND KSQL_COL_NAME ='FCONFIRMQTY') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONFIRMQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY_R' AND KSQL_COL_NAME ='FCONFIRMBASEQTY') 
 ALTER TABLE T_SM_SALORDERENTRY_R ADD (FCONFIRMBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_RETURNAPPLYENTRY' AND KSQL_COL_NAME ='FCONFIRMQTY') 
 ALTER TABLE T_SM_RETURNAPPLYENTRY ADD (FCONFIRMQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_RETURNAPPLYENTRY' AND KSQL_COL_NAME ='FCONFIRMBASEQTY') 
 ALTER TABLE T_SM_RETURNAPPLYENTRY ADD (FCONFIRMBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY' AND KSQL_COL_NAME ='FOWNERTYPE') 
 ALTER TABLE T_SM_SALORDERENTRY ADD (FOWNERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SM_SALORDERENTRY' AND KSQL_COL_NAME ='FOWNERID') 
 ALTER TABLE T_SM_SALORDERENTRY ADD (FOWNERID BIGINT DEFAULT 0 NOT NULL );

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