I was wondering if it is possible to nest an if statement in a stored Procedure...
I want to do someithing like;
If @variable1 =-1 THEN
IF @Variable2 = -1 THEN
select abc from d
ELSE
select efg from h
END IF
ELSE
IF @Variable2 = -1 THEN
select ijk from l
ELSE
select mno from p
END IF
END IF
Anyone got any ideas how i can created a stored proc that can do this or recomend a better way... perhaps with a Case statement???
hope someone can help... cheers
I want to do someithing like;
If @variable1 =-1 THEN
IF @Variable2 = -1 THEN
select abc from d
ELSE
select efg from h
END IF
ELSE
IF @Variable2 = -1 THEN
select ijk from l
ELSE
select mno from p
END IF
END IF
Anyone got any ideas how i can created a stored proc that can do this or recomend a better way... perhaps with a Case statement???
hope someone can help... cheers