/**Begin D:\PDM_UPGRADE\PDM1\SOEHRR_constraint.sql **/
EXEC P_ALTERPK 'PK_SOEHRR_CYCFILLUNITS', 'T_SOEHRR_CYCFILLUNITS', 'FPKID', '1';

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


EXEC P_ALTERPK 'PK_SOEHRR_AUTOCOLLRECORD', 'T_SOEHRR_AUTOCOLLRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SOEHRR_AUTOCOLLRECORD') CREATE INDEX IDX_SOEHRR_AUTOCOLLRECORD ON T_SOEHRR_AUTOCOLLRECORD ( FCYCTASKID );


EXEC P_ALTERPK 'PK_SOEHRR_DISDATEENTRY', 'T_SOEHRR_DISDATEENTRY', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_SOEHRR_CYCCOLLECTTASK', 'T_SOEHRR_CYCCOLLECTTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SOEHRR_CYCCOLLECTTASK') CREATE INDEX IDX_SOEHRR_CYCCOLLECTTASK ON T_SOEHRR_CYCCOLLECTTASK ( FDISORG ,FREPORTCLASSIFY );


EXEC P_ALTERPK 'PK_SOEHRR_AUTOCOLLRECORD_L', 'T_SOEHRR_AUTOCOLLRECORD_L', 'FPKID', '1';

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


EXEC P_ALTERPK 'PK_SOEHRR_CYCCOLLECTTASK_L', 'T_SOEHRR_CYCCOLLECTTASK_L', 'FPKID', '1';

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


EXEC P_ALTERPK 'PK_SOEHRR_TASKCONFENTRY', 'T_SOEHRR_TASKCONFENTRY', 'FENTRYID', '1';

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



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