I have a query as followed. I would get multiple MethodID from the select. Do I use while loop or another way to read each MethodID retrieved from the select to compromise the IF ELSE? (@PID would be a input parameter) How do I do it?
SELECT DISTINCT MethodID FROM Table
WHERE PID = @PID
IF @MethodID = 10
EXEC sp1
ELSE IF @MethodID = 20
EXEC sp2