I think I may need help with query optimization. We have a customer table and an address table. Each customer can have 1 or more addresses in the address table. Thetask is to synchronize customer information from 2 entirely separatesystems. I have a stored procedure that reads a text file (exportedfrom the 'master' system) and updates all the customer records in thesecond system (which is in the sql server db). The queries themselveswork. The data is accurate. My issue is with how long it takes thestored procedure to run. With over 11,000 records in the text file, thestored procedure sometimes takes over 3 hours to run. That seems excessive to me. (and probably to those of you snickering in the back) As an overview: my stored procedure does the following. 1) creates a temp table 2) dumps the data from the text file into the temp table 3) updates the address table with data from the temp table (records already there) 4) inserts records into the address table from the temp table (records not already there) 5) updates the customer table with an address id 6) drops the temp table Any help/suggestions is appreciated. If you need more info, let me know.