/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FACCOUNTCRITERION') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FACCOUNTCRITERION BIGINT DEFAULT 0 NOT NULL );
 
 /**update T_TCTB_APITUDEINFO set FCOMPANYTYPE='0' where FCOMPANYTYPE='' or FCOMPANYTYPE=' ' or FCOMPANYTYPE is null;**/
 
 EXEC p_AlterColumn 'T_TCTB_APITUDEINFO', 'FCOMPANYTYPE', 'BIGINT', 'NOT NULL', '1111', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_APITUDEINFO' AND KSQL_COL_NAME ='FPROFITTYPE') 
 ALTER TABLE T_TCTB_APITUDEINFO ADD (FPROFITTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );

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