I have a list of upwards 3,000 decimal values and for each one I need to lookup another decimal value from a SQL Server database. Currently I'm using the .Net SqlClient
classes.
Making 3,000 queries seems inefficient, but I'm not sure if there's a neat efficient way of combining the queries into few calls.
The lookup table currently contains about 1,500,000 values and I don't want to retrieve any values from the database except those that actually needs to be looked up (so I can't cache the whole table in memory etc).
What's the best way of doing this?