/**Begin D:\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_PERMLOGBASEINFOA', 'T_HRCS_PERMLOGBASEINFOA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEFUNCA', 'T_HRCS_PERMLOGROLEFUNCA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGARCHIVE_L', 'T_HRCS_PERMLOGARCHIVE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGINFLUUSERA', 'T_HRCS_PERMLOGINFLUUSERA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEFIELDA', 'T_HRCS_PERMLOGRANGEFIELDA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEADMINA', 'T_HRCS_PERMLOGROLEADMINA', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_PERMLOGROLEADMINA') CREATE INDEX IDX_HRCS_PERMLOGROLEADMINA ON T_HRCS_PERMLOGROLEADMINA ( FENTRYID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEBDDRA', 'T_HRCS_PERMLOGRANGEBDDRA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGINFLUROLEA', 'T_HRCS_PERMLOGINFLUROLEA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEOPENA', 'T_HRCS_PERMLOGROLEOPENA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEDRA', 'T_HRCS_PERMLOGRANGEDRA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGROLEDIMA', 'T_HRCS_PERMLOGROLEDIMA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGARCHIVE', 'T_HRCS_PERMLOGARCHIVE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEBIZA', 'T_HRCS_PERMLOGRANGEBIZA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMLOGRANGEORGA', 'T_HRCS_PERMLOGRANGEORGA', 'FENTRYID', '1';

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

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