Hi Nav User123,
I cannot stress enough what manjusree has said about not making changes via the SQL Server. You run the risk of running into many unforeseen consequences. If you must do something like this, ask your partner or a NAV developer to help you accomplish this from the NAV development environment. And make a backup of your database first.
While your SQL script has likely cleaned up the data within the immediate table or two, there will remain orphaned entries in other tables and these will rear their ugly heads when you least expect it.
Your choices are either following Lewis Rosenerg's suggestion (that manjusree has linked to), and that requires some coding. Or:
1. Make a backup of the database, and ensure nobody is accessing the system while you do this
2. Note the Item quantity by location, bin, and variant code, and the valuation/cost of the item at each location.
3. Use the Item Journal to post Negative Adjustment(s) for this item by Location, Bin and Variant code to bring both Qty. on Hand and valuation to $0.
4. Rename this Item to something else, and mark it Blocked, so it can no longer be used. Create a new Item with the number that was originally assigned to the old item. Copy all the good parameters (besides Item Tracking related ones) to the new Item, including creating Stockkeeping Units, if applicable. This could be a manual process, or you can create a NAV Processing Report (script) to do this.
5. Use the Item Journal to post Positive Adjustment(s) for this item by Location, Bin and Variant code to bring the Qty. on Hand and valuation back to what it is supposed to be.
If you only need to do this for one item, or a handful of items, it shouldn't be very exhaustive. But if it's a large number of items, you may want to speak with a NAV developer to accomplish this by code.
I hope this helps. If my response has answered your question, please take a moment to verify by clicking "Yes" to "Did this answer your question?"