I have a report in which the user can choose zero or more of several fields. Then I call a stored procedure with the values to the fields choosed and NULL to the others. How can I write my select in order to get good performance, without table scans? My procedure, which works but don't use good indexes, is something like: create proc p1 @a int, @b int, @c int as select x,y,z from table1 -- with good index on column a, for example where a = isnull(@a,a) and b = isnull(@b,b) and c = isnull(@c,c) Another way, that also don't use good indexes, is: where ((@a is not null) and a = @a) or (@a is null)) and ((@b is not null) and b = @b) or (@b is null)) and ((@c is not null) and c = @c) or (@c is null)) Actually, my procedure has more than 10 arguments. Anybody has a tip?