These queries are intended to repair datasets that have inventory numbers that are out of sync with the sum of the inventory log numbers.

High. Data is modified in this query. Do not run this except under the direction of a Cyrious Technical Support staff member. Doing otherwise may result in lost or contaminated data. All data modifications done through direct SQL are permanent and non-reversable.

All of the queries necessary are located in DevShared at \\cyrious14\DevShared$\Other\Inventory Fix Queries.

Step 1

Run the SQL called “Inventory Balance View - Split.sql”. This is to analyze whether there was an out of balance caused by a bug in the Adjust Part Information Setup.

This SQL will produce 3 results:

  1. Parts whose out of balance are strictly due to the bug in Adjust Part Info.
  2. Parts whose out of balance are not due to the bug in Adjust Part Info.
  3. Parts whose out of balance may be partly due to the bug in Adjust Part Info.

If the results of the first and third query returns no rows, then it is safe to proceed to #Step 3.

Step 2

Execute the SQL called “Part Info Inventory Fix.sql”.

This query will repair all of the parts whose out of balance are due to the bug in Adjust Part Info.

All records effected by this query will be backed up before they are modified. The backed up records will be located in the following tables:

  • BadPartInfo_Journal
  • BadPartInfo_InventoryLog
  • BadPartInfo_Ledger

Step 3

Execute the SQL called “Bad Inventory ID Fix.sql”.

This will repair the remaining inventory out of balances. It will set the numbers in the Inventory table to the sum of the inventory log numbers.

  • Entered : 01/12/2010
  • Version :
You could leave a comment if you were logged in.