I have a query in the following format where @ID takes about 20000 IDs.
select * from students where name in (@ID)
Because of the high amount of IDs in the list, I'm getting the error that "query processor ran out of internal resources and could not produce a query plan. I cannot put these IDs into a table and retrieve as it will require a cursor to proceed with. Please advice me if there are any other ways of writing this same query where I can execute it without getting the error.
mayooran99