Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Update a table column with a sequence number v3

By richardd,

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=1643
v2:
http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1664


Since neither script requires a specific order for the sequence number, the same result can be achieved with a single UPDATE statement.

Total article views: 192 | Views in the last 30 days: 3
 
Related Articles
FORUM

script to change the port number

script to change the port number

FORUM

Script for changing the port number & disable Named Pipes protocol

Script for changing the port number & disable Named Pipes protocol

FORUM

Script for Changing Port Number of SQL Server 2005

Script for Changing Port Number of SQL Server 2005

FORUM

Script for changing the port number & disable Named Pipes protocol

Script for changing the port number & disable Named Pipes protocol

SCRIPT

Two scripts to spell out numbers in words

These SQL functions will allow you to convert decimal numbers to words

Tags
miscellaneous    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones