Hi Folks,
I have a parameter in a stored proc that can be null, a single value or a list of values delimited by commas, here's my problem
If the value is null I want the field to be any value but if it's not I want it to be in the list, how to I put that in the where clause?
The logic is something like
if @var is null then
EnterpriseId > 0
else EnterpriseId in (@var)
I have a parameter in a stored proc that can be null, a single value or a list of values delimited by commas, here's my problem
If the value is null I want the field to be any value but if it's not I want it to be in the list, how to I put that in the where clause?
The logic is something like
if @var is null then
EnterpriseId > 0
else EnterpriseId in (@var)
Comment