
EXEC p_DropIdx 'IDX_MDS_DATEENTRY', 'T_MDS_DATEENTRY';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_DATEENTRY') CREATE INDEX IDX_MDS_DATEENTRY ON T_MDS_DATEENTRY ( FID ,FSEQ ,FID2 );

EXEC p_DropIdx 'IDX_MDS_FCDATATSENTRY', 'T_MDS_FCDATATSENTRY';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATATSENTRY') CREATE INDEX IDX_MDS_FCDATATSENTRY ON T_MDS_FCDATATSENTRY ( FID ,FSEQ ,FID2 ,FSEQ2 );

 EXEC P_ALTERPK 'PK_T_MDS_FCDATATS_MULTI', 'T_MDS_FCDATATS_MULTI', 'FID2', '1';

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


