/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_GUIDEMENU', 'T_BCM_GUIDEMENU', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_GUIDEMENU_NUM') CREATE INDEX IDX_BCM_GUIDEMENU_NUM ON T_BCM_GUIDEMENU ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_BCM_GUIDEMENU_L', 'T_BCM_GUIDEMENU_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_GUIDEMENU_L') CREATE INDEX IDX_GUIDEMENU_L ON T_BCM_GUIDEMENU_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BCM_GUIDEMENUENTRY', 'T_BCM_GUIDEMENUENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_GUIDEMENUENTRY_FID') CREATE INDEX IDX_GUIDEMENUENTRY_FID ON T_BCM_GUIDEMENUENTRY ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_GUIDEMENUPERM', 'T_BCM_GUIDEMENUPERM', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_GUIDEMENUPERM_FID') CREATE INDEX IDX_BCM_GUIDEMENUPERM_FID ON T_BCM_GUIDEMENUPERM ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_MODELOLAP_DIMRANGE', 'T_BCM_MODELOLAP_DIMRANGE', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_OLAP_DIMRANGE_FID') CREATE INDEX IDX_OLAP_DIMRANGE_FID ON T_BCM_MODELOLAP_DIMRANGE ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_MODELOLAP_RECORD_L', 'T_BCM_MODELOLAP_RECORD_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_OLAP_RECORD_L') CREATE INDEX IDX_OLAP_RECORD_L ON T_BCM_MODELOLAP_RECORD_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BCM_MENUBASE', 'T_BCM_MENUBASE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_MENUBASE_NUM') CREATE INDEX IDX_BCM_MENUBASE_NUM ON T_BCM_MENUBASE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_BCM_MENUBASE_L', 'T_BCM_MENUBASE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_MENUBASE_L_FID') CREATE INDEX IDX_T_BCM_MENUBASE_L_FID ON T_BCM_MENUBASE_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BCM_STATUS', 'T_BCM_STATUS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_STATUS_SYPC') CREATE INDEX IDX_BCM_STATUS_SYPC ON T_BCM_STATUS ( FSCENARIO ,FYEAR ,FPERIOD ,FCURRENCY ,FORG );



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