/**Begin D:\DBA\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INVRELATIONSET' AND KSQL_COL_NAME IN ('FTOTALSCORE')) 
 ALTER TABLE T_BCM_INVRELATIONSET ADD (FTOTALSCORE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDMAPPINGENTRY' AND KSQL_COL_NAME IN ('FMEMBER')) 
 ALTER TABLE T_BCM_BDMAPPINGENTRY ADD (FMEMBER VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDIMPORT' AND KSQL_COL_NAME IN ('FERRORMSG')) 
 ALTER TABLE T_BCM_BDIMPORT ADD (FERRORMSG NVARCHAR(500) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INVCTRLORGSETTING') 
 CREATE TABLE T_BCM_INVCTRLORGSETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCSLSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FCTRLORG VARCHAR(100) DEFAULT ' ' NOT NULL,
FMERGEORG VARCHAR(100) DEFAULT ' ' NOT NULL,
FISPEEK CHAR(1) DEFAULT '0' NOT NULL
);



/**End D:\DBA\PDM_UPGRADE\PDM1\BCM_table.sql **/
