I'm using SQL Server 2005 with asp.net C#.
There is a search query on my site with different parameters.
fromAge as tinyint
toAge as tinyint
fromHeight as tinyint
toHeight as tinyint
gender as tinyint
withImage as bit
region as tinyint
astrologicaSign as tinyint
If you can align the parameter values you are passing to be equal to the values you want to retreive (or at least always do an equals comparison) then you can use CASE WHEN quite efectively like this
SELECT * FROM User WHERE picture1 = CASE WHEN @WithImage = 1 THEN @withImage ELSE picture1 END
That way it is comparing the picture1 field with the parameter if it is 1 or comparing the field with itself if it is not.