Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Updating a field in a record that in turn updates all the fields in all the other records.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-15 : 00:33:01
Erik writes "I have some code and a database I am working with. In the record there is a field labeled Rank. What I am wanting to do is when the the Rank in one Record is changed all the others will update.

Example:

Tom's Vote Rank 4
Bob's Vote Rank 5
Joe's Vote Rank 6
Jay's Vote Rank 7
Mac's Vote Rank 8

Now the database updates and now Jay is ranked 4th

Jay's Vote Rank 4
Tom's Vote Rank 4
Bob's Vote Rank 5
Joe's Vote Rank 6
Mac's Vote Rank 8

When Jay's rank is set to 4 how do I update all ranks > 4 so that all will count from 4.. so tom would go to 5 bob 6 joe 7

Now as the database grows say somebody ranked in the 100's jumps up to the 20's or 30's. Then you have about 50+ records to update and all in mere seconds so when they check the rankings they will be ready.

If you could offer any help I would appreciate it."
   

- Advertisement -