/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT_L' AND KSQL_COL_NAME ='FASSETNAME') 
 ALTER TABLE T_FA_LEASE_CONTRACT_L ADD (FASSETNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT' AND KSQL_COL_NAME ='FASSETNAME') 
 ALTER TABLE T_FA_LEASE_CONTRACT ADD (FASSETNAME NVARCHAR(50) DEFAULT ' ' NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_RENT_SETTLE' AND KSQL_COL_NAME ='FNEXTSETTLEDATE') 
 ALTER TABLE T_FA_LEASE_RENT_SETTLE ADD (FNEXTSETTLEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_RENT_SETTLE' AND KSQL_COL_NAME ='FNEXTSETTLEDATEMONTH') 
 ALTER TABLE T_FA_LEASE_RENT_SETTLE ADD (FNEXTSETTLEDATEMONTH INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_RENT_SETTLE' AND KSQL_COL_NAME ='FSETTLEDATEMONTH') 
 ALTER TABLE T_FA_LEASE_RENT_SETTLE ADD (FSETTLEDATEMONTH INT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT' AND KSQL_COL_NAME ='FASSETQTYCREATE') 
 ALTER TABLE T_FA_LEASE_CONTRACT ADD (FASSETQTYCREATE INT DEFAULT 0 NOT NULL );
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
