Trying to do something very simple. Using If/Then, is there a way to run a separate Select statement based on the value of a variable? The function GetTotalActiveUnits() in the below code returns an integer.
set @RetVal = GetTotalActiveUnits(CustomerCode);
if @RetVal = 0 then
Select * from tblREF_UnitInfo;
else
select * from tblREF_State;
end if
Aucun commentaire:
Enregistrer un commentaire