How do I use an SQL statement to return all rows if the input parameter is empty, otherwise only return rows that match?
My SQL looks like this
where person.personstatusuid = @StatusUID
AND person.forename != ''
AND person.location = @Location
but I want basically, person.location = @Location OR @Location is blank
How do I do it? Using CASE WHEN perhaps...