I have a table,
Contacts:
Contact_ID (int)
ContactName (nvarchar)
I am given a list of contact IDs to select from. Usually, i would just do
SELECT *
FROM Contacts
WHERE IN (List of contact ID)
The problem is, the list of contact IDs could potentially get very big, like 50k or more.
So my question is, Is there a way to deal with a large list of contact IDs without having to use the IN clause?
EDIT: I'm using Microsoft sql server. The query and the contact IDs are built during runtime and passed on to sqlCommand class (c#) to be executed.