In a stored procedure, I want to update a large data set based on some conditions, So what is better:
Scenario 1 (one select multiple if)
Select All Data records then
LOOP
IF (Condition1 == true)
execute update statement
IF (Condition2 == true)
execute update statements
END LOOP
Scenario 2 (multiple selects with where)
Select Data where (condition 1) loop
execute update statements
end loop
Select Data where (condition 2) loop
execute update statements
end loop