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

383 reads

Blogs

Microsoft finally adds Tenant Switcher for Fabric / Power BI

By

Praise whatever deity you believe in, because it’s finally here, a tenant switcher for...

Microsoft Releases Windows 11 ARM ISO – A Game Changer for ARM-Powered Devices

By

Yesterday, Microsoft released the highly anticipated Windows 11 ARM ISO image, marking a major...

Building Effective Data Governance Framework: Top Areas to Focus On

By

The post Building Effective Data Governance Framework: Top Areas to Focus On appeared first...

Read the latest Blogs

Forums

Pull mssql to Postgres

By Bruin

Does anyone have a script\example that would connect to SQL server instance run a...

Fill in missing hours for each VisitID during the day

By NineIron

create table #T ( VisitID varchar(30), ER_Date date, HR int ) insert into #T(VisitID,...

Database copy for report work load

By ashrukpm

Hi Team, I am looking for a an help, Please see my problem below....

Visit the forum

Question of the Day

The Hash Join I

What are the two inputs called to a hash join operation in SQL Server? (choose 2)

See possible answers