Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select and set to variable
Message
De
08/03/2015 06:39:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
07/03/2015 16:45:24
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01616353
Message ID:
01616434
Vues:
34
>>Actually, we've found that keeping the stock is best done by totalling the transactions, completely ignoring the current stock. Any new transaction (or update to existing) will trigger this recalculation for the item involved, but the number in the stock table is pretty much read only. Turned out to be much cleaner than relying on any previously stored stock amount/price/quantity. But, OTOH, yes, ONE transaction table.
>
>Cleaner yes, but certainly I/O intensive to get the current stock. It depends on what fits best.

Getting the current stock is read operation, that's read from the stock table. It's the maintenance of it, which we did only by totalling the transactions. Any attempt to calculate it from current stock and the current transaction failed sooner or later. Pretty much any guy, whom I know to have tried that, also had to have a routine which would recalculate it from scratch from transactions alone.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform