/**Begin D:\PDM_UPGRADE\PDM1\HBSS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HBSS_SCORESYSTEM', 'T_HBSS_SCORESYSTEM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_SCORESYSTEM_L', 'T_HBSS_SCORESYSTEM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_SCORESYSTEMTAG', 'T_HBSS_SCORESYSTEMTAG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_SCORESYSTEMTAG_L', 'T_HBSS_SCORESYSTEMTAG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_SCORESYSTEMTAG_L') CREATE INDEX IDX_HBSS_SCORESYSTEMTAG_L ON T_HBSS_SCORESYSTEMTAG_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVEL', 'T_HBSS_PERFLEVEL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVEL_L', 'T_HBSS_PERFLEVEL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELSCORE', 'T_HBSS_PERFLEVELSCORE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELSCOREMAP', 'T_HBSS_PERFLEVELSCOREMAP', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_PERFLEVELSCOREMAP') CREATE INDEX IDX_HBSS_PERFLEVELSCOREMAP ON T_HBSS_PERFLEVELSCOREMAP ( FENTRYID );


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELSCOREMAP_L', 'T_HBSS_PERFLEVELSCOREMAP_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_PERFLEVELSCOREMAP_L') CREATE INDEX IDX_HBSS_PERFLEVELSCOREMAP_L ON T_HBSS_PERFLEVELSCOREMAP_L ( FDETAILID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELRULE', 'T_HBSS_PERFLEVELRULE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELRULERMAP', 'T_HBSS_PERFLEVELRULERMAP', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_PERFLEVELRULERMAP') CREATE INDEX IDX_HBSS_PERFLEVELRULERMAP ON T_HBSS_PERFLEVELRULERMAP ( FENTRYID );


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELRULERMAP_L', 'T_HBSS_PERFLEVELRULERMAP_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_PERFLEVELRULERMAP_L') CREATE INDEX IDX_HBSS_PERFLEVELRULERMAP_L ON T_HBSS_PERFLEVELRULERMAP_L ( FDETAILID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_RULEGRADE', 'T_HBSS_RULEGRADE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_RULEGRADE_L', 'T_HBSS_RULEGRADE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_RULEGRADECONFIG', 'T_HBSS_RULEGRADECONFIG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_RULEGRADECONFIG_L', 'T_HBSS_RULEGRADECONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_RULEGRADECONFIG_L') CREATE INDEX IDX_HBSS_RULEGRADECONFIG_L ON T_HBSS_RULEGRADECONFIG_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_RULEGRADEMAP', 'T_HBSS_RULEGRADEMAP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HBSS_RULEGRADEMAP_L', 'T_HBSS_RULEGRADEMAP_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_RULEGRADEMAP_L') CREATE INDEX IDX_HBSS_RULEGRADEMAP_L ON T_HBSS_RULEGRADEMAP_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELCONFIG_L', 'T_HBSS_PERFLEVELCONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HBSS_PERFLEVELCONFIG_L') CREATE INDEX IDX_HBSS_PERFLEVELCONFIG_L ON T_HBSS_PERFLEVELCONFIG_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_PERFLEVELCONFIG', 'T_HBSS_PERFLEVELCONFIG', 'FENTRYID', '1';

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



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