I've done this before but can't find where :/
I want to create a variable inside a stored proc and return its value which will be set depending on whether or not other selects return results.
basically something like this:
@myVar int = 0
BEGIN
IF
SELECT SomeThing FROM SomeTable
@myVar = 1
ELSE IF
SELECT SomeOther From SomeOtherTAble
@myVar = 2
ELSE
@myVar = 0
SELECT @myVar
END
tried that and no dice...and I can't for the life of me remember where I did this in the past.