When a computer is retired, to free up the license an inventory clean-up is run that purges inventory data from the computer's record. This purge does not include software data, specifically for the data classes:
Software Inventory is collected by the Software Management Framework and is not "managed" by Inventory. Because of this the data does not affect license consumption, and was not included in the inventory clean-up.
This is working as designed.
However there have been a lot of requests for this functionality. As such the attached stored procedure is provided "As is" for those who want the inventory clean up to also purge the software inventory data classes for the retired computers.
To apply, please follow these steps: