/**BEGIN D:\K3CLOUD\PDM_UPGRADE\PDM1\MDS_CONSTRAINT.SQL **/
 EXEC P_ALTERPK 'PK_MSPLAN_ORNEEDPLAN', 'T_MSPLAN_ORNEEDPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_ORNEEDPLAN_FK') CREATE INDEX IDX_MSPLAN_ORNEEDPLAN_FK ON T_MSPLAN_ORNEEDPLAN ( FBILLSTATUS );


 EXEC P_ALTERPK 'PK_MSPLAN_ORNEEDPLANENTRY', 'T_MSPLAN_ORNEEDPLANENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MSPLAN_EQXNEEDPLAN', 'T_MSPLAN_EQXNEEDPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_EQXNEEDPLAN_FK') CREATE INDEX IDX_MSPLAN_EQXNEEDPLAN_FK ON T_MSPLAN_EQXNEEDPLAN ( FBILLSTATUS );


 EXEC P_ALTERPK 'PK_MSPLAN_EQXNEEDPLANENTRY', 'T_MSPLAN_EQXNEEDPLANENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MSPLAN_TLNEEDPLAN', 'T_MSPLAN_TLNEEDPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_TLNEEDPLAN_FK') CREATE INDEX IDX_MSPLAN_TLNEEDPLAN_FK ON T_MSPLAN_TLNEEDPLAN ( FBILLSTATUS );


 EXEC P_ALTERPK 'PK_MSPLAN_TLNEEDPLANENTRY', 'T_MSPLAN_TLNEEDPLANENTRY', 'FENTRYID', '1';

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



/**END D:\K3CLOUD\PDM_UPGRADE\PDM1\MDS_CONSTRAINT.SQL **/
