I have a multiple selection listbox on a web form which lists various internal activity codes, and users can filter the results of a query based on the codes selected. I can easily add a single code as a parameter to my stored procedure and filter the results with a WHERE clause like so:
WHERE ActivityCode = @ActivityCode OR @ActivityCode is null
but what is the best practise for handling multiple codes, especially when the number of codes selected is arbitrary?