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

379 reads

Blogs

Flying Halfway Around the World to Australia

By

I leave tonight for Australia. I was in London 3 days ago, so this...

Dealing with Change – Two Resources

By

As I look at the state of information technology today, I see one constant:...

Cloud Databases Made Simple: Creating Your First AWS RDS Instance

By

I recently started full time learning of Amazon Web Services (AWS). I found that...

Read the latest Blogs

Forums

insert duplicate records with new timestamp

By Tara-1044200

how can i insert records from a transaction table into a transaction table with...

Performance benchmarking tools for SQL Server

By MichaelT

Are there any performance test tools that can check the performance of a SQL...

Backing up and Restoring a 3 terabyte database takes over 5 hours

By ericwenger1

I have a 3 terabyte database that is taking over 5 hours to backup...

Visit the forum

Question of the Day

Using Table Hints in a Query

How many table hints can I include in a query?  

See possible answers