/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_ACCOUNTMAPPING', 'T_EB_ACCOUNTMAPPING', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ACCOUNTMAPPING_FK') CREATE  CLUSTERED INDEX IDX_EB_ACCOUNTMAPPING_FK ON T_EB_ACCOUNTMAPPING ( FID );


 EXEC P_ALTERPK 'PK_T_EB_DATAUPLOADDIMMAP', 'T_EB_DATAUPLOADDIMMAP', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATAUPLOADDIMMAP_FK') CREATE  CLUSTERED INDEX IDX_EB_DATAUPLOADDIMMAP_FK ON T_EB_DATAUPLOADDIMMAP ( FID );


 EXEC P_ALTERPK 'PK_T_EB_DATAUPLOADLOG', 'T_EB_DATAUPLOADLOG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATAUPLOADLOG_FK') CREATE  CLUSTERED INDEX IDX_EB_DATAUPLOADLOG_FK ON T_EB_DATAUPLOADLOG ( FMODEL ,FENTITY );


 EXEC P_ALTERPK 'PK_T_EB_DATAUPLOADSCHEME_L', 'T_EB_DATAUPLOADSCHEME_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_EB_DATAUPLOADLOG_L', 'T_EB_DATAUPLOADLOG_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_EB_DATAUPLOADSCHEME', 'T_EB_DATAUPLOADSCHEME', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATAUPLOADSCHEME_NUM') CREATE  CLUSTERED INDEX IDX_EB_DATAUPLOADSCHEME_NUM ON T_EB_DATAUPLOADSCHEME ( FMODELBD );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULESETREF', 'T_EB_BIZRULESETREF', 'FENTRYID', '1';

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


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