It takes the product, depo and amount, and then: The first one is selecting each row that has an exitdepot specified.UPDATE PRODUCTDETAILS SET E_CIKAN=QTY WHERE PRODUCTDETAILS SET WHERE NEXT FROM SA INTO SAīased on our conversation in my other answer to this question, I think I have found a way to speed up your routine. SELECT ,QTY,E_CIKAN FROM PRODUCTDETAILS WHERE (QTY>E_CIKAN) AND AND ORDER BY ASCįETCH NEXT FROM SA INTO = 0) AND -current record isnt sufficient, use it and move on SELECT ,PRODUCTID,QTY,EXITDEPOT FROM PRODUCTDETAILS WHERE (EXITDEPOT IS NOT NULL) ORDER BY ASC ĭECLARE varchar(50) -SK = STOKKODU = PRODUCTID, DP = DEPOTĭECLARE float -Demand=Quantity, We'll decrease it record by record Here's the stored procedure translated into English CREATE PROC. My SP can handle this fine as seen in picture, except it's REALLY slow. It takes 2 unit from 1st record and 1 unit from 5th record. This is where the problem comes in: 3 unit needs to leave depot 01.Notice now 1st record has E_CIKAN set to 18. 5 Unit leaves 01 (E_CIKAN for 1st record will be 15 now).Whereas GDEPO:Entry depot, CDEPO:Exit depot,Adet: quantity,E_CIKAN quantity that's used. I Have a cursor in stored procedure under SQL Server 2000 (not possible to update right now) that updates all of table but it usually takes few minutes to complete.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |