/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANEBILL' AND KSQL_COL_NAME IN ('FORDERSORT')) 
 ALTER TABLE T_ER_PLANEBILL ADD (FORDERSORT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_VEHICLEBILL_A' AND KSQL_COL_NAME IN ('FORDERSORT')) 
 ALTER TABLE T_ER_VEHICLEBILL_A ADD (FORDERSORT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_VEHICLECHECKINGBILL_A' AND KSQL_COL_NAME IN ('FORDERSORT')) 
 ALTER TABLE T_ER_VEHICLECHECKINGBILL_A ADD (FORDERSORT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_HOTELCHECKINGBILL' AND KSQL_COL_NAME IN ('FORDERSORT')) 
 ALTER TABLE T_ER_HOTELCHECKINGBILL ADD (FORDERSORT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_HOTELBILL' AND KSQL_COL_NAME IN ('FORDERSORT')) 
 ALTER TABLE T_ER_HOTELBILL ADD (FORDERSORT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_ALLORDERBILL' AND KSQL_COL_NAME IN ('FORDERSORT')) 
 ALTER TABLE T_ER_ALLORDERBILL ADD (FORDERSORT VARCHAR(30) DEFAULT ' ' NOT NULL );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
