/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKREPORT' AND KSQL_COL_NAME IN ('FMODEL')) 
 ALTER TABLE T_BCM_CHKREPORT ADD (FMODEL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKREPORT' AND KSQL_COL_NAME IN ('FSENCE')) 
 ALTER TABLE T_BCM_CHKREPORT ADD (FSENCE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKREPORT' AND KSQL_COL_NAME IN ('FYEAR')) 
 ALTER TABLE T_BCM_CHKREPORT ADD (FYEAR BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKREPORT' AND KSQL_COL_NAME IN ('FPERIOD')) 
 ALTER TABLE T_BCM_CHKREPORT ADD (FPERIOD BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKREPORT' AND KSQL_COL_NAME IN ('FORG')) 
 ALTER TABLE T_BCM_CHKREPORT ADD (FORG BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKREPORT' AND KSQL_COL_NAME IN ('FTEMPLATE')) 
 ALTER TABLE T_BCM_CHKREPORT ADD (FTEMPLATE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FLFORMULATMP')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FLFORMULATMP VARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FRFORMULATMP')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FRFORMULATMP VARCHAR(2000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CHKFORMULASETTING' AND KSQL_COL_NAME IN ('FSTATUS')) 
 ALTER TABLE T_BCM_CHKFORMULASETTING ADD (FSTATUS CHAR(1) DEFAULT '1' NOT NULL );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BCM_table.sql **/
