/**Begin D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ADJUSTTMPCOMDIM' AND KSQL_COL_NAME ='FCOMENTITYSIGN') 
 ALTER TABLE T_BCM_ADJUSTTMPCOMDIM ADD (FCOMENTITYSIGN VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ADJUSTTMPSPREADDIM' AND KSQL_COL_NAME ='FSPREADENTITYSIGN') 
 ALTER TABLE T_BCM_ADJUSTTMPSPREADDIM ADD (FSPREADENTITYSIGN VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSMAINDATA' AND KSQL_COL_NAME ='FCOMPANYCODE') 
 ALTER TABLE T_BCM_DSMAINDATA ADD (FCOMPANYCODE NVARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSMAINDATA' AND KSQL_COL_NAME ='FREPORTRULESID') 
 ALTER TABLE T_BCM_DSMAINDATA ADD (FREPORTRULESID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSMAINDATA' AND KSQL_COL_NAME ='FRULESCHANGES') 
 ALTER TABLE T_BCM_DSMAINDATA ADD (FRULESCHANGES NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSMAINDATA' AND KSQL_COL_NAME ='FRULESCHANGES2') 
 ALTER TABLE T_BCM_DSMAINDATA ADD (FRULESCHANGES2 NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSMAINDATA' AND KSQL_COL_NAME ='FRULESCHANGES3') 
 ALTER TABLE T_BCM_DSMAINDATA ADD (FRULESCHANGES3 NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DSMAINDATAVERSION') 
 CREATE TABLE T_BCM_DSMAINDATAVERSION (
FID BIGINT DEFAULT 0 NOT NULL,
FCOMPANYCODE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTRULEID BIGINT DEFAULT 0 NOT NULL,
FC1RULEID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
