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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_EB_DYNAMICREPORT') CREATE INDEX IX_EB_DYNAMICREPORT ON T_EB_DYNAMICREPORT ( FTASKPROCESSID );


 EXEC P_ALTERPK 'PK_T_EB_EXAMINECHECK', 'T_EB_EXAMINECHECK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXAMINECHECK') CREATE INDEX IDX_EB_EXAMINECHECK ON T_EB_EXAMINECHECK ( FCREATER );


 EXEC P_ALTERPK 'PK_T_EB_EXAMINERESULT', 'T_EB_EXAMINERESULT', 'FID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXAMINERESULT') CREATE INDEX IDX_EB_EXAMINERESULT ON T_EB_EXAMINERESULT ( FCREATEDATE );


 EXEC P_ALTERPK 'PK_T_EB_EXAMINECATEGORY', 'T_EB_EXAMINECATEGORY', 'FID', '1';

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

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


 EXEC P_ALTERPK 'PK_T_EB_EXECANALYZEHISTORY', 'T_EB_EXECANALYZEHISTORY', 'FID', '1';

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


EXEC p_DropIdx 'IDX_EB_CONTROLPRO_ITEMORG', 'T_EB_CONTROLPROCESSSET';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CONTROLPRO_ITEMORG') CREATE INDEX IDX_EB_CONTROLPRO_ITEMORG ON T_EB_CONTROLPROCESSSET ( FADMINORG );

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

 EXEC P_ALTERPK 'PK_T_EB_PJOTEMPLATECATA_L', 'T_EB_PJOTEMPLATECATA_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_EXAMINE', 'T_EB_EXAMINE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXAMINE_GROUP') CREATE INDEX IDX_EB_EXAMINE_GROUP ON T_EB_EXAMINE ( FGROUP );


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


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