/**Begin D:\\PDM_UPGRADE\PDM_UPGRADE\PDM1\HIES_constraint.sql **/
 EXEC P_ALTERPK 'PK_HIES_DIAETPLCONF_L', 'T_HIES_DIAETPLCONF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLFIELDCONF_L', 'T_HIES_DIAETPLFIELDCONF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLFIELDCONF', 'T_HIES_DIAETPLFIELDCONF', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLENTITY', 'T_HIES_DIAETPLENTITY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLCONF', 'T_HIES_DIAETPLCONF', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAESYSPARAM', 'T_HIES_DIAESYSPARAM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_DSP_FCREATORID') CREATE INDEX IDX_HIES_DSP_FCREATORID ON T_HIES_DIAESYSPARAM ( FCREATORID );


 EXEC P_ALTERPK 'PK_HIES_DIAETPLORG', 'T_HIES_DIAETPLORG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLROLE', 'T_HIES_DIAETPLROLE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLROLEORG', 'T_HIES_DIAETPLROLEORG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_DIAETPLUSER', 'T_HIES_DIAETPLUSER', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_TASKINFO', 'T_HIES_TASKINFO', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_TASKINFO_SERNO') CREATE INDEX IDX_HIES_TASKINFO_SERNO ON T_HIES_TASKINFO ( FSERIALNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_TASKINFO_CTIME') CREATE INDEX IDX_HIES_TASKINFO_CTIME ON T_HIES_TASKINFO ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_TASKINFO_FSCHE') CREATE INDEX IDX_HIES_TASKINFO_FSCHE ON T_HIES_TASKINFO ( FSCHEDULESTATUS );

 EXEC P_ALTERPK 'PK_HIES_TASKINFO_L', 'T_HIES_TASKINFO_L', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_HIES_DIAECONDFIELDCONF', 'T_HIES_DIAECONDFIELDCONF', 'FENTRYID', '1';

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

 EXEC P_ALTERPK 'PK_HIES_ENTITYENCRYPTCONF', 'T_HIES_ENTITYENCRYPTCONF', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_ENTITYENCRYPTCONF_EID') CREATE INDEX IDX_HIES_ENTITYENCRYPTCONF_EID ON T_HIES_ENTITYENCRYPTCONF ( FENTITYID );


 EXEC P_ALTERPK 'PK_HIES_ENTITYENCRYPTCONF_L', 'T_HIES_ENTITYENCRYPTCONF_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HIES_IMPTEMPLATEUSERS', 'T_HIES_IMPTEMPLATEUSERS', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_HIES_TPLSHEETCONF', 'T_HIES_TPLSHEETCONF', 'FENTRYID', '1';

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



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