/**Begin D:\DBA\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSPPARAMENTITY' AND KSQL_COL_NAME IN ('FYEAROFFSET')) 
 ALTER TABLE T_BCM_DSPPARAMENTITY ADD (FYEAROFFSET INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSPPARAMENTITY' AND KSQL_COL_NAME IN ('FPERIODOFFSET')) 
 ALTER TABLE T_BCM_DSPPARAMENTITY ADD (FPERIODOFFSET INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSPPARAMENTITY' AND KSQL_COL_NAME IN ('FEFFECTIVERANGE')) 
 ALTER TABLE T_BCM_DSPPARAMENTITY ADD (FEFFECTIVERANGE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSPPARAMENTITY' AND KSQL_COL_NAME IN ('FMERGESET')) 
 ALTER TABLE T_BCM_DSPPARAMENTITY ADD (FMERGESET VARCHAR(10) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_BCM_STRUCTOFPERIOD_S', 'FUSEYEAR', 'VARCHAR(2000)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_COMPONENT_INFO_L') 
 CREATE TABLE T_BCM_COMPONENT_INFO_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);



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