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

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYCALDEF_L', 'T_MDS_PROBABILITYCALDEF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYHP', 'T_MDS_PROBABILITYHP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYRESULT', 'T_MDS_PROBABILITYRESULT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_PROBABILITYRESULT') CREATE INDEX IDX_MDS_PROBABILITYRESULT ON T_MDS_PROBABILITYRESULT ( FLOGID );


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYRP', 'T_MDS_PROBABILITYRP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_PROBABILITYSP', 'T_MDS_PROBABILITYSP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_SAMPLE', 'T_MDS_SAMPLE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_SAMPLE') CREATE INDEX IDX_MDS_SAMPLE ON T_MDS_SAMPLE ( FLOGID );


 EXEC P_ALTERPK 'PK_MDS_SAMPLEHISRECORD', 'T_MDS_SAMPLEHISRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_SAMPLEHISRECORD') CREATE INDEX IDX_MDS_SAMPLEHISRECORD ON T_MDS_SAMPLEHISRECORD ( FLOGID );


 EXEC P_ALTERPK 'PK_MDS_STOCKUPSCHEME', 'T_MDS_STOCKUPSCHEME', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_STOCKUPSCHEME_L', 'T_MDS_STOCKUPSCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MDS_STOCKUPSTATUS', 'T_MDS_STOCKUPSTATUS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_STOCKUPSTATUS_BILLNO') CREATE INDEX IDX_MDS_STOCKUPSTATUS_BILLNO ON T_MDS_STOCKUPSTATUS ( FBILLNO );



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