Using Navision 3.7, SQL 2000.
It appears some of our SIFT tables are corrupt. Specifically for Item Ledger Entries. The Quantity on Hand from the SIFT tables does not match the sum of the Quantity field in Item Ledger Entry.
Dropping and Creating the indexes has not fixed the issue. Any thoughts on why this happens and how to fix it?
0
Answers
BTW what do you mean by "Dropping and Creating" that sounds like SQL terminology. So is that a typo, and are you actually deleting the key and re-creating it (or deactivate/reactive) in Navision table designer, or are you actually doing this in SQL?
Although there have been times that I have been forced to manually change things in the Item Ledger Entry table (despite my protests), this is a recent development. For the item I'm using as my test case, it shows Quantity on Hand = 1, where the sum of the Quantity fields from the drill down is actually 0. I have also confirmed with SQL scripts that the quantities are different by querying the Item Ledger Entries and SIFT table(s) directly.
I watched our DBA Drop and Create the indexes from SQL Server, and they completed successfully, but the results are the same as if nothing had been done. Thanks for your help.
The important thing about a Navision FBK is that it only backs up the data, not the keys and sift data, so on a restore all that information is rebuilt.
This can be manually fixed through SQL Server by giving the objects the hard coded name Navision is using.
So your other alternative is to rename the objects correctly by looking at equivalent objects that do not have this problem.
The SIFT tables are updated thru triggers from the parent table, so you can check the trigger for the item ledger table and then the table names and field names used for the associated sift tables.
http://mibuso.com/blogs/davidmachanick/
#-o I had forgotten about this, but our DBA wrote a SQL job to "reindex" (I think drop and recreate) the indexes and possibly constraints on the most heavily hit tables in our database. I remember thinking it seemed like a bad idea at the time, but really had no evidence to contradict what was being said. I will investigate further and let everyone know what I find out.
VERY frustrating. Again, this was SQL 2000 and Navision 3.7. Not sure it was correct in later versions of either.
Regards,
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03