I have a SP that gives me a lot of hard times.
The sp gets a two parameters @madeByUserId and @reportedByUserId. I want to have something like:
select
Try:
select * from table where MadeByUserId = @madeByUserId AND (@reportedByUserID IS null OR ReportedByUserID = @reportedByUserID)