Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to reduce time taken for query

Status
Not open for further replies.

557

Programmer
Oct 25, 2004
64
US
i have a text file with about 60,000 lines. i need to transfer the records in the text file into 2 tables depending on whether the value of the field "product" is amoung the products of a master table with about 15 records only.the way i'm doing it now is as follows thru vb6

1)i upload all lines of text file into table1

2)in this table1, i check the field 'product' against master table and insert all records with 'product' in master table into the 2nd table table2

3)then,i do the same check again on table1 and delete all records from table1 if the 'product' is in the master table.

this is how i've transferred the contents of text file into 2 tables. but, this takes veryyyyyyyyyy long time to process. roughly 50 minutes.

can anyone tell me a better way to do this?

i'm pasting the sql i use for transferring contents to 2nd table and also for deleting the transferred things from 1st table.

'for insertion
insert into table2 select * from table1 where product in (select glstm_product from fcc_glschemetypemap)

'for deletion
delete from table1 where product in (select glstm_product from fcc_glschemetypemap)
 
First check which part takes most of these 50 minutes. How are you importing txt file into table1?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top