/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_TEMPLATECATALOG', 'T_EB_TEMPLATECATALOG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_TEMPLATECATALOG_L', 'T_EB_TEMPLATECATALOG_L', 'FPKID', '1';

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


EXEC p_DropIdx 'IDX_EB_BgControlRecord_ExtBiz', 'T_EB_BGCONTROLRECORD';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BGCONTROLRECORD_REFBIZ') CREATE INDEX IDX_EB_BGCONTROLRECORD_REFBIZ ON T_EB_BGCONTROLRECORD ( FREFBIZID );

 EXEC P_ALTERPK 'PK_T_EB_ANALYSISTHEMETYPE', 'T_EB_ANALYSISTHEMETYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_ANALYSISTHEMETYPENAME') CREATE INDEX INDEX_ANALYSISTHEMETYPENAME ON T_EB_ANALYSISTHEMETYPE ( FNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_EB_CHARTACCOUNT') CREATE INDEX INDEX_EB_CHARTACCOUNT ON T_EB_ANALYSISCHARTACCOUNT ( FACCOUNTID );


 EXEC P_ALTERPK 'PK_T_EB_ANALYSISCHART', 'T_EB_ANALYSISCHART', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ANALYSISCHARTCODE') CREATE INDEX IDX_EB_ANALYSISCHARTCODE ON T_EB_ANALYSISCHART ( FCODE );



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