/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INVTEMPLATECATALOG_L' AND KSQL_COL_NAME IN ('FFINSTRUCTION')) 
 ALTER TABLE T_BCM_INVTEMPLATECATALOG_L ADD (FFINSTRUCTION NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INVTEMPLATECATALOG' AND KSQL_COL_NAME IN ('FFINSTRUCTION')) 
 ALTER TABLE T_BCM_INVTEMPLATECATALOG ADD (FFINSTRUCTION NVARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_FILELISTENTITY' AND KSQL_COL_NAME IN ('FCREATORID')) 
 ALTER TABLE T_BCM_FILELISTENTITY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_FILELISTENTITY' AND KSQL_COL_NAME IN ('FMODIFIERID')) 
 ALTER TABLE T_BCM_FILELISTENTITY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_FILELISTENTITY' AND KSQL_COL_NAME IN ('FCREATETIME')) 
 ALTER TABLE T_BCM_FILELISTENTITY ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_FILELISTENTITY' AND KSQL_COL_NAME IN ('FMODIFYTIME')) 
 ALTER TABLE T_BCM_FILELISTENTITY ADD (FMODIFYTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_MEMBERLIST' AND KSQL_COL_NAME IN ('FISENABLE')) 
 ALTER TABLE T_BCM_MEMBERLIST ADD (FISENABLE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ENTRYNUMBERPREFIX') 
 CREATE TABLE T_BCM_ENTRYNUMBERPREFIX (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 1 NOT NULL,
FPREFIX VARCHAR(50) DEFAULT ' ' NOT NULL
);



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