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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Queries - Fastest Query Time

Status
Not open for further replies.

bowettwow

Programmer
Aug 1, 2002
57
GB
I have a table which contains two fields:

ProductCode
StockQuantity

Each day I have messages build up on a queue from an external source which simply contain a product code. I then have send a reply message with the product code and the quantity in stock. Nothing too tricky there.

The problem I have is there could be thousands of messages on the queue. What I want to avoid is having to run thousands of individual queries e.g SELECT productcode, stockquantity FROM stock WHERE productcode = '12345'; because I'm woried it will take too long.

What's the quickest way to achieve what I want? I thought if I read all the messages off the queue and created a temporary table to use on a JOIN?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top