/**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_ACCOUNTMETRIC' AND KSQL_COL_NAME ='FCHANGE') 
 ALTER TABLE T_BCM_ACCOUNTMETRIC ADD (FCHANGE CHAR(1) DEFAULT '1' NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_BCM_ACCOUNTMETRIC', 'CHANGE', 'NULL', 'NULL', '1001', 'NULL';

 EXEC p_AlterColumn 'T_BCM_RPTADJUSTDATA', 'FDESCRIPTION', 'NCLOB', 'NULL', '1111', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INVRELATION_TEMP') 
 CREATE TABLE T_BCM_INVRELATION_TEMP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BIZRULE' AND KSQL_COL_NAME ='FDEBUG') 
 ALTER TABLE T_BCM_BIZRULE ADD (FDEBUG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BIZRULE' AND KSQL_COL_NAME ='FRUNSTATUS') 
 ALTER TABLE T_BCM_BIZRULE ADD (FRUNSTATUS CHAR(1) DEFAULT ' ' NOT NULL );

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