/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_ADJUSTBILL_TC_FTBIDTID') CREATE INDEX IDX_IM_ADJUSTBILL_TC_FTBIDTID ON T_IM_ADJUSTBILL_TC ( FTBILLID,FTID );
 
 EXEC p_DropIdx 'IDX_IM_ASSEMBBILL_TC_TBILL', 'T_IM_ASSEMBBILL_TC';
 EXEC p_DropIdx 'IDX_IM_ASSEMBBILL_TC_TID', 'T_IM_ASSEMBBILL_TC';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_ASSEMBBILL_TC_FTBIDTID') CREATE INDEX IDX_IM_ASSEMBBILL_TC_FTBIDTID ON T_IM_ASSEMBBILL_TC ( FTBILLID,FTID );
 
 EXEC p_DropIdx 'IDX_IM_DISASSEMBLEBILL_TC_TBILL', 'T_IM_DISASSEMBLEBILL_TC';
 EXEC p_DropIdx 'IDX_IM_DISASSEMBLEBILL_TC_TID', 'T_IM_DISASSEMBLEBILL_TC';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_DISASSEMBLE_TC_FTBIDTID') CREATE INDEX IDX_IM_DISASSEMBLE_TC_FTBIDTID ON T_IM_DISASSEMBLEBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_INVCOUNT_TC_FTBIDTID') CREATE INDEX IDX_IM_INVCOUNT_TC_FTBIDTID ON T_IM_INVCOUNTBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MREQ_TC_FTBIDTID') CREATE INDEX IDX_IM_MREQ_TC_FTBIDTID ON T_IM_MREQBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MREQOUT_TC_FTBIDTID') CREATE INDEX IDX_IM_MREQOUT_TC_FTBIDTID ON T_IM_MREQOUTBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_OTHERIN_TC_FTBIDTID') CREATE INDEX IDX_IM_OTHERIN_TC_FTBIDTID ON T_IM_OTHERINBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_OTHEROUT_TC_FTBIDTID') CREATE INDEX IDX_IM_OTHEROUT_TC_FTBIDTID ON T_IM_OTHEROUTBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_PRODUCTIN_TC_FTBIDTID') CREATE INDEX IDX_IM_PRODUCTIN_TC_FTBIDTID ON T_IM_PRODUCTINBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_PURREC_TC_FTBIDTID') CREATE INDEX IDX_IM_PURREC_TC_FTBIDTID ON T_IM_PURRECBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_TRANSDIR_TC_FTBIDTID') CREATE INDEX IDX_IM_TRANSDIR_TC_FTBIDTID ON T_IM_TRANSDIRBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_TRANSIN_TC_FTBIDTID') CREATE INDEX IDX_IM_TRANSIN_TC_FTBIDTID ON T_IM_TRANSINBILL_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_TRANSOUT_TC_FTBIDTID') CREATE INDEX IDX_IM_TRANSOUT_TC_FTBIDTID ON T_IM_TRANSOUTBILL_TC ( FTBILLID,FTID );
 
 EXEC p_DropIdx 'IDX_IM_LOCATIONTRANSFER_TC_TBILL', 'T_IM_LOCATIONTRANSFER_TC';
 EXEC p_DropIdx 'IDX_IM_LOCATIONTRANSFER_TC_TID', 'T_IM_LOCATIONTRANSFER_TC';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_LOCATIONTSF_TC_FTBIDTID') CREATE INDEX IDX_IM_LOCATIONTSF_TC_FTBIDTID ON T_IM_LOCATIONTRANSFER_TC ( FTBILLID,FTID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_TRANSAPPLY_TC_FTBIDTID') CREATE INDEX IDX_IM_TRANSAPPLY_TC_FTBIDTID ON T_IM_TRANSAPPLY_TC ( FTBILLID,FTID );
 
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/