loops through each row of a SELECT statement, and runs some code.
A while loop
is a generic loop construct.
However, SQL server works best with set-based queries, so neither will be efficient.
If there is a specific requirement that you would like help architecturing let us know :-)
EDIT: beaten to it by a few minutes