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: )

372 reads

Blogs

Blogging for the Tech Professional at Denver Dev Days

By

For those that attended my talk at Denver Dev Days, here are the slides:...

Getting AI Written Unit Tests

By

As a part of my AI experiments, I decided to ask CoPilot to write...

A New Word: Slipfast

By

slipfast adj. longing to disappear completely; to melt into a crowd and become invisible,...

Read the latest Blogs

Forums

Software Flexibility (Avoiding the next hack)

By Louis Davidson (@drsql)

Comments posted to this topic are about the item Software Flexibility (Avoiding the next...

Roles on tempdb

By cphite

A co-worker asked me a question today and I couldn't come up with an...

Delayed tcp acknowledgement registry setting

By Rasmus Remmer Bielidt

Our IT department contacted me recently and asked if they should change the default...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers