Monday, March 10, 2008

Traverse through SQL Table rows

Here is the code to traverse (iterate) through each row in SQL table...

DECLARE @i INT
SET @i = 1

WHILE (@i<= (SELECT count(*) FROM table_name) )
BEGIN
/* Your Code here...*/
SET @i=@i+1
END

No comments: