/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HBSS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HBSS_APPOINTTYPE', 'T_HBSS_APPOINTTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_APPOINTTYPE' AND KSQL_INDNAME = 'IDX_HBSS_APPOINTTYPE') CREATE INDEX IDX_HBSS_APPOINTTYPE ON T_HBSS_APPOINTTYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_HBSS_APPOINTTYPE_L', 'T_HBSS_APPOINTTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_APPOINTTYPE_L' AND KSQL_INDNAME = 'IDX_HBSS_APPOINTTYPE_L') CREATE INDEX IDX_HBSS_APPOINTTYPE_L ON T_HBSS_APPOINTTYPE_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_APPOINTTYPEGROUP', 'T_HBSS_APPOINTTYPEGROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_APPOINTTYPEGROUP' AND KSQL_INDNAME = 'IDX_HBSS_APPOINTTYPEGROUP') CREATE INDEX IDX_HBSS_APPOINTTYPEGROUP ON T_HBSS_APPOINTTYPEGROUP ( FNUMBER );


 EXEC P_ALTERPK 'PK_HBSS_APPOINTTYPEGROUP_L', 'T_HBSS_APPOINTTYPEGROUP_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_APPOINTTYPEGROUP_L' AND KSQL_INDNAME = 'IDX_HBSS_APPOINTTYPEGROUP_L') CREATE INDEX IDX_HBSS_APPOINTTYPEGROUP_L ON T_HBSS_APPOINTTYPEGROUP_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_APPTREASONGROUP', 'T_HBSS_APPTREASONGROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_APPTREASONGROUP' AND KSQL_INDNAME = 'IDX_HBSS_APPTREASONGROUP') CREATE INDEX IDX_HBSS_APPTREASONGROUP ON T_HBSS_APPTREASONGROUP ( FNUMBER );


 EXEC P_ALTERPK 'PK_HBSS_APPTREASONGROUP_L', 'T_HBSS_APPTREASONGROUP_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_APPTREASONGROUP_L' AND KSQL_INDNAME = 'IDX_HBSS_APPTREASONGROUP_L') CREATE INDEX IDX_HBSS_APPTREASONGROUP_L ON T_HBSS_APPTREASONGROUP_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HBSS_CADRECATEGORY', 'T_HBSS_CADRECATEGORY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_CADRECATEGORY' AND KSQL_INDNAME = 'IDX_HBSS_CADRECATEGORY_NUMBER') CREATE INDEX IDX_HBSS_CADRECATEGORY_NUMBER ON T_HBSS_CADRECATEGORY ( FNUMBER );


 EXEC P_ALTERPK 'PK_HBSS_CADRECATEGORY_L', 'T_HBSS_CADRECATEGORY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HBSS_CADRECATEGORY_L' AND KSQL_INDNAME = 'IDX_HBSS_CADRECATEGORY_L') CREATE INDEX IDX_HBSS_CADRECATEGORY_L ON T_HBSS_CADRECATEGORY_L ( FID ,FLOCALEID );



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