This seemingly should be pretty simple, but I'm having difficulty finding an answer. I'm writing a basic open-ended select function, and am trying to find how to select for all supplied values.
This is my best guess on how this would look, but search engines are only yielding answers to more complex of questions today.
DECLARE
@nAge INT = @age
@nHeight INT = @height
@nWeight INT = @weight
SELECT *
FROM table
WHERE ((EXISTS(@nAge) AND nAge = @nAge) OR true)
AND ((EXISTS(@nHeight) AND nHeight = @nHeight) OR true)
AND ((EXISTS(@nWeight) AND nWeight = @nWeight) OR true)
Here's a few links I checked first: