/**Begin D:\PDM_UPGRADE\PDM1\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_INVCASEENTITY', 'T_BCM_INVCASEENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVCASEENT') CREATE INDEX IDX_BCM_INVCASEENT ON T_BCM_INVCASEENTITY ( FMODELID ,FSCENARIOID ,FCATALOGID );


 EXEC P_ALTERPK 'PK_T_BCM_INVCASEENTITY_L', 'T_BCM_INVCASEENTITY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_INVCASEDISTRIBUTE', 'T_BCM_INVCASEDISTRIBUTE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_INVCASEENTRY', 'T_BCM_INVCASEENTRY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVCASEETY') CREATE INDEX IDX_BCM_INVCASEETY ON T_BCM_INVCASEENTRY ( FINVCHANGECASE );


 EXEC P_ALTERPK 'PK_T_BCM_INVDIMENTRY', 'T_BCM_INVDIMENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_INVCASEPAGEDIM', 'T_BCM_INVCASEPAGEDIM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVCASEPDIM') CREATE INDEX IDX_BCM_INVCASEPDIM ON T_BCM_INVCASEPAGEDIM ( FMODELID ,FSCENARIOID ,FYEARID ,FCASEID );


 EXEC P_ALTERPK 'PK_T_BCM_INVHANDLELOG', 'T_BCM_INVHANDLELOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVHANDLELOG') CREATE INDEX IDX_BCM_INVHANDLELOG ON T_BCM_INVHANDLELOG ( FCASEPAGEDIMID );



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