
 EXEC P_ALTERPK 'PK_MDS_ORDERPOOLDATA', 'T_MDS_ORDERPOOLDATA', 'FID', '1';
 EXEC P_ALTERPK 'PK_MDS_ORDERPOOLSETDATA', 'T_MDS_ORDERPOOLSETDATA', 'FID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_ORDERPOOLDATA_SALBILL') CREATE INDEX IDX_MDS_ORDERPOOLDATA_SALBILL ON T_MDS_ORDERPOOLDATA ( FSALBILLID,  FSALBILLENTRYID);


 EXEC P_ALTERPK 'PK_MDS_ORDERPOOLSETDATA_L', 'T_MDS_ORDERPOOLSETDATA_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_ORDERPOOLSETDATA_L_ID') CREATE INDEX IDX_MDS_ORDERPOOLSETDATA_L_ID ON T_MDS_ORDERPOOLSETDATA_L ( FID ,FLOCALEID );
 
  EXEC P_ALTERPK 'PK_MDS_ORDERPOOLRES', 'T_MDS_ORDERPOOLRES', 'FID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_ORDERPOOLRES_FORDERPOOLID') CREATE INDEX IDX_MDS_ORDERPOOLRES_FORDERPOOLID ON T_MDS_ORDERPOOLRES ( FORDERPOOLID);


 EXEC P_ALTERPK 'PK_MDS_ORDERPOOLRESENTRY', 'T_MDS_ORDERPOOLRESENTRY', 'FENTRYID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_ORDERPOOLRESENTRY_ID') CREATE INDEX IDX_MDS_ORDERPOOLRESENTRY_ID ON T_MDS_ORDERPOOLRESENTRY ( FID );

  EXEC P_ALTERPK 'PK_MDS_ORDERPOOLDATAENTRY', 'T_MDS_ORDERPOOLBILLENTRY', 'FENTRYID', '1';

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