 EXEC P_ALTERPK 'PK_HAOS_STAFFRULEENTRY', 'T_HAOS_STAFFRULEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFRULEORG', 'T_HAOS_STAFFRULEORG', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFORGEMPCOUNT', 'T_HAOS_STAFFORGEMPCOUNT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_STAFFORGEMPCOUNT_FID') CREATE INDEX IDX_HAOS_STAFFORGEMPCOUNT_FID ON T_HAOS_STAFFORGEMPCOUNT ( FUSEORGBOID );
