Unless you really need to go through the rows one-by-one I really advise to try to use set based operations.
SQL is a language optimized for manipulating and handling sets of data. From a performance point of view this is always the fastest way but also from the coding point of view, set operations are really effective.
For example if you need to give a 10% raise to all people working in a certain department, instead of looping through the rows, calculating the new salary and updating the row you could use a single statement like
UPDATE person
SET Salary = Salary * 1.1
WHERE Department = ...
If creating a single statement for the job becomes to complex you can always utilize
temporary tables[
^],
table variables[
^] and so on.