Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select and set to variable
Message
From
08/03/2015 06:39:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
07/03/2015 16:45:24
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2014
Application:
Web
Miscellaneous
Thread ID:
01616353
Message ID:
01616434
Views:
35
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform