I would like to have a variable (parameter) used as the ENTIRE where statement in a Proc. Something like Select * from table @WHEREVAR.
I know I can make my query a string and use the syntax exec ('select ....' + @WHEREVAR) but is there a way to evaluate the var and use it in a regular statement?
Thanks