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

Can we delete devices 'Awaiting Inventory'?

We have over 40K devices with 'Awaiting Inventory' status and I would like to delete those devices as many are never going to be sending inventory since they have since been decommissioned.  

Can we delete, in batches, from ComplianceComputer (status=4) those devices stuck at 'Awaiting Inventory'?

I see there are cascade deletes from ComplianceComputer that should cleanup any related data.

(1) Solution
JJacildo
By Level 6 Flexeran
Level 6 Flexeran

Hello Kevin,

ComplianceComputerStatusID = 4 is also considered as 'Dummy' records. Dummy records are created from Asset records so probably the best approach here is to delete the Asset Records instead?

You can use the following stored procedure "[dbo].[AssetRemoveBatch]"

The idea here is to locate all the Asset records you want to delete then transfer them into a staging table called #Asset. The stored procedure will match the AssetID in #Asset with Asset table to delete and will drop the #Asset in the end.

I hope that helps.

View solution in original post

(1) Reply
JJacildo
By Level 6 Flexeran
Level 6 Flexeran

Hello Kevin,

ComplianceComputerStatusID = 4 is also considered as 'Dummy' records. Dummy records are created from Asset records so probably the best approach here is to delete the Asset Records instead?

You can use the following stored procedure "[dbo].[AssetRemoveBatch]"

The idea here is to locate all the Asset records you want to delete then transfer them into a staging table called #Asset. The stored procedure will match the AssetID in #Asset with Asset table to delete and will drop the #Asset in the end.

I hope that helps.