Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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: 195 | Views in the last 30 days: 2
 
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