First of all you fetch total information in one DataSet (or) DataTable.
After that you can use foreach loop , fetch the each and every row information. Inside the foreach you write you update query. this is in application wise...
ex:
DataTable dt=
foreach(DataRow dr in dt.Rows)
{
}
In DB itself also you can do this
Ex:
DataSet ds=
string data =ds.GetXML();
In your SQL SP itself you can follow the below steps to achieve this
Fetch the XML path information and store it in one temprory table. Then,
DECLARE @MINCOUNT INT , @MAXCOUNT INT
SELECT @MAXCOUNT = COUNT(*) FROM #TEMPTable
SET @MINCOUNT = 1
DECLARE @Update_Count VARCHAR(10)
SET @Update_Count=0
While( @MINCOUNT<= @MAXCOUNT)
BEGIN
//UPDATE QUERY
//SET @Update_Count=@Update_Count+1
SET @MINCOUNT= @MINCOUNT+1
END
THIS is DB side....