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

386 reads

Blogs

The trade-offs associated with low-code solutions

By

Low-code solutions often accelerate development and make tasks accessible to people who can’t or...

Monday Monitor Tips: Looking Back in Time

By

Often we find out about a problem reported by a customer after the incident...

Can You Tell Why a Plan Didn’t Go Parallel?

By

Let’s face it, most of the time, you probably don’t want your SQL Server...

Read the latest Blogs

Forums

Where to see how a Partition schema and function is defined

By jaango123

Please see the below. The dependencies of a table(the table depends on) shows Partition...

Is there a way to determine an Azure Data Factory Trigger's "next run time"?

By Orlando Colamatteo

Many job schedulers (e.g., SQL Agent, Airflow, Azure Logic Apps) can report when a...

The Table Backup

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Table Backup

Visit the forum

Question of the Day

The Table Backup

I run this code in SQL Server 2022. What happens?

BACKUP TABLE beercount TO DISK = 'beercount.bak'
 

See possible answers