Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Renumbering rows -- need idea
Message
De
29/02/2008 08:00:55
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Renumbering rows -- need idea
Divers
Thread ID:
01297681
Message ID:
01297681
Vues:
64
I have three tables: Headers, LineItems, and Receivers.

The primary key for Headers is ReqId. The primary keys for the other two are ReqId+LineItemNumber.

12345 1
12345 2
12345 3 etc.

Since these are printed on the Purchase order with the line item number they have to keep the correct order. 1, 2, 3, etc.

If the user deletes a line item:
12345 1
12345 3

these two tables have to be renumbered to keep the line item numbers in correct sequence. Since the two primary keys make the row unique, I am trying to think of the best way to handle this.

I think I am going to have to do this through a stored procedure, and I think I need to create a temporary table to do this. But I haven't figured out the sequence yet.

I need some ideas as to how to do this in the best and fastest way. Any ideas?

Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform