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

381 reads

Blogs

Calling a REST Endpoint from Azure SQL DB

By

External REST endpoint invocation in Azure SQL DB went GA in August 2023. Whereas...

Monday Monitor Tips – Adding Redgate Monitor Custom Metrics from SQLMonitorMetrics

By

This post talks about adding custom metrics from the sqlmonitormetrics.com site automatically and how...

Microsoft 365 Security and Compliance for Administrators, a Book Review

By

I was asked to review the following book by the publisher, and I must...

Read the latest Blogs

Forums

how can vs see SSIS under my regular user id but not my admin?

By stan

Hi, we run vs 2022.   I'm stumped how when i run VS as admin...

error in both ssis and ssms - something about losing connections - new error

By stan

hi for about 4 or 5 days now, i've been seeing various connections (to...

The Biggest Database Professional Challenges Today

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Biggest Database Professional Challenges...

Visit the forum

Question of the Day

The Last DBCC Date

How can I easily get the last DBCC CheckDB date from T-SQL in SQL Server 2022?

See possible answers