I'm running a sql statement that takes in a parameter to filter for 'tID'. However its possible for the user not to filter the results, thereby selecting all rows from table 'Tour'. How do I include the option for selecting ALL records?Select * from TourWhere (tDeleted = 0) and CASE WHEN @param1 THEN (tID = ?ALL?) ELSE tID = @param1 END
There is some bad syntax in that option, but I've tried this as well:Select * from TourWhere (tDeleted = 0) and tID IN (coalesce(@param1, ?ALL?))