Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Querying large tables using many conditions
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Querying large tables using many conditions
Miscellaneous
Thread ID:
00352719
Message ID:
00352719
Views:
42
I'm curious to know what people think the best method of performing the following query.

I have a table of 1,000,000 customers. I also have a transaction table that has several million records in it. Providing table design is good, indexes are built correctly, and so forth, how would you recommend I query the transaction table for 450,000 of the customers? The only real way I have heard this far is to have a temp table that I insert the customer IDs into and then query the transaction table using the IDs from the temp table (customers.id = trasaction.custid). Do you agree this is the best way or is there another.

I want to keep traffic to the server down to a minimum. Using the method above, I will still have to do a one massive insert or several thousand inserts to the temp table.

Thanks for any ideas.
Thanks-

Lee Forst
Senior Project Manager
ProphetLine, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform