/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_MDS_ALGORITHMDEF', 'T_MDS_ALGORITHMDEF', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_ALGORITHMDEF_L', 'T_MDS_ALGORITHMDEF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_ALGORITHMDEST', 'T_MDS_ALGORITHMDEST', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_ALGORITHMSRC', 'T_MDS_ALGORITHMSRC', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYDETAILS', 'T_MDS_PROBABILITYDETAILS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYDETAILS_L', 'T_MDS_PROBABILITYDETAILS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_SAMPLERECORD', 'T_MDS_SAMPLERECORD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_SAMPLERECORD_L', 'T_MDS_SAMPLERECORD_L', 'FPKID', '1';

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



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
