/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_constraint.sql **/

EXEC p_DropIdx 'IDX_ER_DYREIMBILL_TC_FID', 'T_ER_DAILYREIMBURSEBILL_TC';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DYREIMBILL_TC_FTBILLID') CREATE INDEX IDX_ER_DYREIMBILL_TC_FTBILLID ON T_ER_DAILYREIMBURSEBILL_TC ( FTBILLID );

EXEC p_DropIdx 'IDX_ER_PUBREIMBILL_TC_FID', 'T_ER_PUBREIMBILL_TC';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_PUBREIMBILL_TC_FTBILLID') CREATE INDEX IDX_ER_PUBREIMBILL_TC_FTBILLID ON T_ER_PUBREIMBILL_TC ( FTBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DLB_FBILLNO') CREATE INDEX IDX_ER_DLB_FBILLNO ON T_ER_DAILYLOANBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DREIM_FBILLNO') CREATE INDEX IDX_ER_DREIM_FBILLNO ON T_ER_DAILYREIMBURSEBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_REIM_FBILLNO') CREATE INDEX IDX_ER_REIM_FBILLNO ON T_ER_REIMBURSEBILL ( FBILLNO );

EXEC p_DropIdx 'IDX_ER_DYAPPBILL_FBIZDTE_ORID', 'T_ER_DAILYAPPLYBILL';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DYAPPBILL_FDATE_NO') CREATE INDEX IDX_ER_DYAPPBILL_FDATE_NO ON T_ER_DAILYAPPLYBILL ( FBIZDATE ,FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DYAPPBILL_FCREATEOR') CREATE INDEX IDX_ER_DYAPPBILL_FCREATEOR ON T_ER_DAILYAPPLYBILL ( FCREATORID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_DYAPPBILL_FCOMPANYID') CREATE INDEX IDX_ER_DYAPPBILL_FCOMPANYID ON T_ER_DAILYAPPLYBILL ( FCOMPANYID );


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