/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FSIMPLEADDRESS') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FSIMPLEADDRESS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FDETAILADDRESS') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FDETAILADDRESS VARCHAR(260) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FCROSSCITYSIGN') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FCROSSCITYSIGN VARCHAR(10) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FAREAUNIT') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FAREAUNIT VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FSTARTLEASEDATE') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FSTARTLEASEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FBUILDINGNAME') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FBUILDINGNAME VARCHAR(190) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FLANDTAXNO') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FLANDTAXNO VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FESTATEID') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FESTATEID VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_VATINVOICE_E' AND KSQL_COL_NAME ='FENDLEASEDATE') 
 ALTER TABLE T_SIM_VATINVOICE_E ADD (FENDLEASEDATE DATETIME );

/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
