/**Begin D:\DBA2024\差量生成\PDM_UPGRADE\PDM1\SBD_constraint.sql **/
 EXEC P_ALTERPK 'PK_BD_SCBOM', 'T_BD_SCBOM', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SCBOM_FMATERIAL') CREATE INDEX IDX_BD_SCBOM_FMATERIAL ON T_BD_SCBOM ( FMATERIALID );


 EXEC P_ALTERPK 'PK_BD_SCBOM_L', 'T_BD_SCBOM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_BD_SCBOMENTRY', 'T_BD_SCBOMENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SCBOMENTRY_VALIDDATE') CREATE INDEX IDX_BD_SCBOMENTRY_VALIDDATE ON T_BD_SCBOMENTRY ( FVALIDDATE ,FINVALIDDATE );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SCBOMENTRY_MATERIAL') CREATE INDEX IDX_BD_SCBOMENTRY_MATERIAL ON T_BD_SCBOMENTRY ( FMATERIALID );


 EXEC P_ALTERPK 'PK_BD_SCBOMENTRY_L', 'T_BD_SCBOMENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SCBOMENTRY_L_FID') CREATE INDEX IDX_BD_SCBOMENTRY_L_FID ON T_BD_SCBOMENTRY_L ( FENTRYID ,FLOCALEID );



/**End D:\DBA2024\差量生成\PDM_UPGRADE\PDM1\SBD_constraint.sql **/
