/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FMM_constraint.sql **/
 EXEC P_ALTERPK 'PK_FMM_DEFECTREASON', 'T_FMM_DEFECTREASON', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DEFECTREASON_L', 'T_FMM_DEFECTREASON_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DEFECTSITE', 'T_FMM_DEFECTSITE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DEFECTSITE_L', 'T_FMM_DEFECTSITE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DEFECTTYPE', 'T_FMM_DEFECTTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DEFECTTYPE_L', 'T_FMM_DEFECTTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DISPOSALMEASURES', 'T_FMM_DISPOSALMEASURES', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_DISPOSALMEASURES_L', 'T_FMM_DISPOSALMEASURES_L', 'FPKID', '1';

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



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