I need to run a query where the results can be filtered by a value ranging from 1 to 11 or any combination thereof. For example:
SELECT * FROM MyTable WHERE Status in (1,2,3)
SELECT * FROM MyTable WHERE Status in (2,4,8,9)
How do I implement this kind of filter in the context of a stored procedure? The filter values would be entered through a VB.NET app and passed to a stored procedure. I thought about dynamic SQL but I want to be as memory-efficient as possible.
thanks in advance
SELECT * FROM MyTable WHERE Status in (1,2,3)
SELECT * FROM MyTable WHERE Status in (2,4,8,9)
How do I implement this kind of filter in the context of a stored procedure? The filter values would be entered through a VB.NET app and passed to a stored procedure. I thought about dynamic SQL but I want to be as memory-efficient as possible.
thanks in advance