Currently I have a stored proc, which takes a string
@vari as varchar(30)
if @vari is null
SELECT * FROM TABLE
else
SELECT * FROM TABLE WHERE col = @vari
endif
is there any way to inline the if statement, thereby not declaring 2 select’s just because of 1 param?
1 Answer