Connecting Tech Pros Worldwide Forums | Help | Site Map

Hard Upgrading !

Newbie
 
Join Date: Aug 2005
Posts: 1
#1: Aug 29 '05
Hi,

Need help to make a script in t-sql for mssql version 2000.


I have a table with fields; cusid, txtdes, ordinal
Data example :
5001 aaaa null
5001 eeee null
5001 oooo null
5003 bbbb null
5003 pppp null
5006 cccc null

I need upgrade the 'ordinal' field like this :
5001 aaaa 1
5001 eeee 2
5001 oooo 3
5003 bbbb 1
5003 pppp 2
5006 cccc 1
5009 kkkk 1

the behavior`s upgrade must star in one, increment in one if 'cusid' is the same and restart if 'cusid' change.


Thanks !!

Reply