/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MDS_FCCORL', 'T_MDS_FCCORL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCCORL') CREATE INDEX IDX_MDS_FCCORL ON T_MDS_FCCORL ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_MDS_FCCORL_L', 'T_MDS_FCCORL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MDS_FCCORLENTRY', 'T_MDS_FCCORLENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCCORLENTRY') CREATE INDEX IDX_MDS_FCCORLENTRY ON T_MDS_FCCORLENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MDS_FCDATA', 'T_MDS_FCDATA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATA') CREATE INDEX IDX_MDS_FCDATA ON T_MDS_FCDATA ( FBILLNO ,FORGID );


 EXEC P_ALTERPK 'PK_T_MDS_FCDATAENTRY', 'T_MDS_FCDATAENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATAENTRY') CREATE INDEX IDX_MDS_FCDATAENTRY ON T_MDS_FCDATAENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MDS_FCDATADTLENT', 'T_MDS_FCDATADTLENT', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_FCDATADTLENT') CREATE INDEX IDX_MDS_FCDATADTLENT ON T_MDS_FCDATADTLENT ( FID ,FSEQ );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDS_constraint.sql **/
