/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_DIMMAPINGENTRY', 'T_BCM_DIMMAPINGENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_DIMMEMBERMAPPING', 'T_BCM_DIMMEMBERMAPPING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_DIMMEMBERMAPPING_SCHEME') CREATE INDEX T_BCM_DIMMEMBERMAPPING_SCHEME ON T_BCM_DIMMEMBERMAPPING ( FSCHEMEID );


 EXEC P_ALTERPK 'PK_T_BCM_INTEGRATESCHEME', 'T_BCM_INTEGRATESCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T__BCM_INTEGRATESCHEME_MODEL') CREATE INDEX T__BCM_INTEGRATESCHEME_MODEL ON T_BCM_INTEGRATESCHEME ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_INTEGRATESCHEME_L', 'T_BCM_INTEGRATESCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_PERIODSRCDIM', 'T_BCM_PERIODSRCDIM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_PERIODSRCDIM_SOURCE') CREATE INDEX T_BCM_PERIODSRCDIM_SOURCE ON T_BCM_PERIODSRCDIM ( FSYSSOURCE );


 EXEC P_ALTERPK 'PK_T_BCM_PERIODSRCDIM_L', 'T_BCM_PERIODSRCDIM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_SCHEMECATALOG', 'T_BCM_SCHEMECATALOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_SCHEMECATALOG_MODEL') CREATE INDEX T_BCM_SCHEMECATALOG_MODEL ON T_BCM_SCHEMECATALOG ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_SCHEMECATALOG_L', 'T_BCM_SCHEMECATALOG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_SCHEMEEASSIGN', 'T_BCM_SCHEMEEASSIGN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_SCHEMEEASSIGN_MODEL') CREATE INDEX T_BCM_SCHEMEEASSIGN_MODEL ON T_BCM_SCHEMEEASSIGN ( FMODEL );


 EXEC P_ALTERPK 'PK_T_BCM_SRCDIMBASEDATA', 'T_BCM_SRCDIMBASEDATA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_SRCDIMBASEDATA_SOURCE') CREATE INDEX T_BCM_SRCDIMBASEDATA_SOURCE ON T_BCM_SRCDIMBASEDATA ( FSYSSOURCE );


 EXEC P_ALTERPK 'PK_T_BCM_SRCDIMBASEDATA_L', 'T_BCM_SRCDIMBASEDATA_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_YEARSRCDIM', 'T_BCM_YEARSRCDIM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_YEARSRCDIM_SYSSOURCE') CREATE INDEX T_BCM_YEARSRCDIM_SYSSOURCE ON T_BCM_YEARSRCDIM ( FSYSSOURCE );


 EXEC P_ALTERPK 'PK_T_BCM_YEARSRCDIM_L', 'T_BCM_YEARSRCDIM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_DIMCOMBMAPPING', 'T_BCM_DIMCOMBMAPPING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_DIMCOMBMAPPING_MODEL') CREATE INDEX T_BCM_DIMCOMBMAPPING_MODEL ON T_BCM_DIMCOMBMAPPING ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_DIMMEMBCOMBENTRY', 'T_BCM_DIMMEMBCOMBENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_DIMMEMBENTRY', 'T_BCM_DIMMEMBENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_SRCDIMMEMBENTRY', 'T_BCM_SRCDIMMEMBENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_DIMMAPPING', 'T_BCM_DIMMAPPING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_DIMMAPPING_SCHEME') CREATE INDEX T_BCM_DIMMAPPING_SCHEME ON T_BCM_DIMMAPPING ( FSCHEMEID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BCM_constraint.sql **/
