Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update from Select
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01673282
Message ID:
01673303
Vues:
46
>>The lowest version is SQL Server 2008 (Express edition). And the FIFO is the correct answer.
>>
>>Question: I am doing all my testing on a temp table. That is, I create a temp table and copy the records from the actual table to the temp table (so, that I don't mess up the real data). And in the SSMS all variables for the temp table are shown with the red squiggly line (under). But the code works. Is this normal that the temp table has these squiggly red lines?
>>
>https://blog.sqlauthority.com/2013/07/04/sql-server-how-to-refresh-ssms-intellisense-cache-to-update-schema-changes/
>
>Too bad that your lowest version is SQL Server 2008 because otherwise it would be a simpler solution.
>
>This may be a bit advanced for you, but take a look https://www.red-gate.com/simple-talk/sql/performance/t-sql-window-function-speed-phreakery-the-fifo-stock-inventory-problem/ (and previous version from that article)

Thank you for the article. Although at this point, I won't have time to study it.

The good thing is your code works for one record. Can you think of why - with the WHILE - the code will not work for multiple records (for the inventory FIFO case)?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform