Searching Google about Cursors in t-SQl might get this result http://www.jackdonnell.com/articles/SQL_CURSOR.htm. Here is an alternative

continue reading.....