/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_ISBASEENTLIST', 'T_BCM_ISBASEENTLIST', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISBASEENTLIST_ENTNUM') CREATE INDEX T_BCM_ISBASEENTLIST_ENTNUM ON T_BCM_ISBASEENTLIST ( FENTITYNUMBER );


 EXEC P_ALTERPK 'PK_T_BCM_ISBASEENTLIST_L', 'T_BCM_ISBASEENTLIST_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAP', 'T_BCM_ISDIMMAP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAP_L', 'T_BCM_ISDIMMAP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAPSRCDEFVAL_L', 'T_BCM_ISDIMMAPSRCDEFVAL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAPTARGDEFVAL_L', 'T_BCM_ISDIMMAPTARGDEFVAL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISPRODUCT', 'T_BCM_ISPRODUCT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISSCHEME', 'T_BCM_ISSCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISSCHEME_FCATALOGID') CREATE INDEX T_BCM_ISSCHEME_FCATALOGID ON T_BCM_ISSCHEME ( FSCHEMECATALOGID );


 EXEC P_ALTERPK 'PK_T_BCM_ISSCHEME_L', 'T_BCM_ISSCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAPSRCDEFVAL', 'T_BCM_ISDIMMAPSRCDEFVAL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPSRCDEFVAL_ET') CREATE INDEX T_BCM_ISDIMMAPSRCDEFVAL_ET ON T_BCM_ISDIMMAPSRCDEFVAL ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAPSRCENTRY', 'T_BCM_ISDIMMAPSRCENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPSRCENTRY_DT') CREATE INDEX T_BCM_ISDIMMAPSRCENTRY_DT ON T_BCM_ISDIMMAPSRCENTRY ( FDIMTYPE );


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAPTARGDEFVAL', 'T_BCM_ISDIMMAPTARGDEFVAL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPTARGDEFVAL_ET') CREATE INDEX T_BCM_ISDIMMAPTARGDEFVAL_ET ON T_BCM_ISDIMMAPTARGDEFVAL ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_BCM_ISDIMMAPTARGENTRY', 'T_BCM_ISDIMMAPTARGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPTARGENTRY_DT') CREATE INDEX T_BCM_ISDIMMAPTARGENTRY_DT ON T_BCM_ISDIMMAPTARGENTRY ( FDIMTYPE );


 EXEC P_ALTERPK 'PK_T_BCM_SCENECURRENCYSCALE', 'T_BCM_SCENECURRENCYSCALE', 'FENTRYID', '1';

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



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