Update a table column with a sequence number v3
Both Sachinvaishnav and Mark Chad have submitted scripts to populate a column with a sequence number. The first solution uses a cursor; the second uses the SQL 2005 ROW_NUMBER() function.v1:http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1643v2:http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1664Since neither script requires a specific order for the sequence number, the same result can be achieved with a single UPDATE statement.
2006-04-26 (first published: 2006-04-11)
384 reads