Bug in ApplyItemLedgEntry due to SQL optimizer

Eugene
Member Posts: 309
If in Item Journal Line you have several lines the lines after first may be not applied when they shoudl. This happens because the
I wonder if MS is going to fix it ?
CASE EntryFindMethod OF '-': IF ItemLedgEntry2.NEXT = 0 THEN EXIT; '+': IF ItemLedgEntry2.NEXT(-1) = 0 THEN EXIT; END;in the ApplyItemLedgEntry function (codeunit 22) skips some open records due to SQL optimizer
I wonder if MS is going to fix it ?
0
Comments
-
I am not clear on your description of the problem. Replicate it in cronus company, and send it to MS. I'm sure they will look at it. If they don't know about it, they won't fix it, given that it actually is a bug.0
-
... due to SQL optimizer ...
And - "just shooting into the dark":
If due to a NEXT statement records are "skipped", this usually means that you have changed the value of a field which is used in the current sorting (SETCURRENTKEY) ... you should check this ...Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
Yes under MSSQL some records may get skipped whereas under native database it does not happen.0
-
Hmmm, I'm still wondering what you mean by "SQL Optimizer".
If you experience a difference with recordsets & sortings between native and SQL you have to be aware, that there is a difference in sorting CODE fields:
While in "native" CODE values are sorted in a numeric way 1,2,3,4,5,6,7,8,9,10,etc. in SQL Server this is alphabetic: 1,10,11,12,13,14,15,2,20,etc.
My guess is, that when you start your "ItemLedgerEntry2" loop you do a SETCURRENTKEY on a CODE-type field which is changed within the loop ... this could cause the trouble you experience ...Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions