/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_MDS_PROBABILITYHP_LOG', 'T_MDS_PROBABILITYHP_LOG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYLOG', 'T_MDS_PROBABILITYLOG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYLOG_L', 'T_MDS_PROBABILITYLOG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYRP_LOG', 'T_MDS_PROBABILITYRP_LOG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYSP_LOG', 'T_MDS_PROBABILITYSP_LOG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBALOG_ACTYPE', 'T_MDS_PROBALOG_ACTYPE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBALOG_CARD', 'T_MDS_PROBALOG_CARD', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBALOG_CARDTYPE', 'T_MDS_PROBALOG_CARDTYPE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBALOG_CHECKTYPE', 'T_MDS_PROBALOG_CHECKTYPE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBALOG_CUSTOMER', 'T_MDS_PROBALOG_CUSTOMER', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBALOG_PROSTATE', 'T_MDS_PROBALOG_PROSTATE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_SAMPLERELUSE', 'T_MDS_SAMPLERELUSE', 'FID', '1';

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



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