We can use Cursors to loop with this Sql Server has provisions to use while loop as well. Using these we can loop through all records in sql server.
Using While loop and cursors.