Showing results for 
Show  only  | Search instead for 
Did you mean: 

need to delete inventory devices in FNMS 2022 R2, need SQL script

Kindly let me know the SQL script to delete the inventory devices from FNMSCompliance and FNMSInventory DB.

Please don't recommend for ignore state beacuse Customer don't want to put into ignore state.

(2) Replies

There are several stored procedures in the FNMS Compliance and Inventory database that can be used to remove inventory devices in bulk. Below are two that should get you started, as the stored procedure names follow the same naming convention. 

Compliance database: 
ComplianceComputerRemoveByID -- requires the ComplianceComputerID to be run

Inventory database:
ComputerRemoveAllByCN --requires the ComputerCN to be run

Before manually removing entries you should make sure that none of the machines that you are deleting are still reporting inventory from any source or they will be recreated in the database. I recommend making a backup of the databases, incase an machines are removed incorrectly.


I am only human; anything said is my view or from my own experience and not necessarily that of Flexera.
If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

Do you have a condition that you can use to create the list of devices that needs to be done?   A good example is in this thread that uses a 90 day threshold as an example (which has since been made obsolete by the Inventory settings option to now remove old items based on last inventory date.)

The script though, if you have another set of logic to build a list of items you want to remove, can be tweaked to generate a temp table of objects--and then execute the DeleteComputers stored procedure in the Inventory DB to do what you're looking for.