/**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 ='FREGISTERPLACE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FREGISTERPLACE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FTAXJURISDICTION') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FTAXJURISDICTION CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FACCTCUSTOMER') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FACCTCUSTOMER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FACCTSUPPLIER') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FACCTSUPPLIER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FDEVELOPMENT') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FDEVELOPMENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FPURCHASE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FPURCHASE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FMANUFACTURE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FMANUFACTURE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FSALES') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FSALES CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FASSETS') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FASSETS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FAMSSERVICE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FAMSSERVICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FLABOR') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FLABOR CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FINTERNALFINANCE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FINTERNALFINANCE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FFINANCIALSERVICE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FFINANCIALSERVICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FINSURE') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FINSURE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FINSTRUMENT') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FINSTRUMENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FOTHERBUSINESS') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FOTHERBUSINESS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FBUSINESSREMARK') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FBUSINESSREMARK NVARCHAR(1000) DEFAULT ' ' NOT NULL );

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