Technical Article

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.

You rated this post out of 5. Change rating

2006-04-26 (first published: )

373 reads

Blogs

Penetration Testing your SQL Server, Part 1 – The Recon Mission

By

Since witnessing a rather nasty cyber attack around a year ago, I’ve been thinking...

SQL Saturday Denver 2023–VCS Primer for the Database slides

By

My slides are here: VCS Primer Denver 2023 This was an overview of what...

Future Data Driven 2023 is This Week

By

The Future Data Driven 2023 virtual conference is coming on Wednesday, September 27. Register...

Read the latest Blogs

Forums

Running a Service

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Running a Service

Creating Two Keys

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Creating Two Keys

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers