I have a stored procedure with a number of parameters. I would like to write my query so that it joins with certain tables but only if a particular parameter has a value. Take
If I understand correctly it sounds like your join conditions would be the equivalent of ON ((@AddressID IS NOT NULL) AND (alias.column = @AddressID)) and likewise for the group join.