What is the correct way to do this? For example, how would I change a stored procedure with this signature:
CREATE PROCEDURE dbo.MyProcedure @Param BIT = NULL AS SELECT * FROM dbo.SomeTable T WHERE T.SomeColumn = @Param
So that giving @Param with a value of 1 or 0 performs the filter, but not specifying it or passing NULL performs no filtering?
Assuming that NULL means ‘don’t care’ then use