How to delete records from a custom inventory table for single resource

Article:HOWTO7225  |  Created: 2007-04-20  |  Updated: 2012-01-26  |  Article URL http://www.symantec.com/docs/HOWTO7225
Article Type
How To



Question
I am testing a custom inventory, and the default behavior is to not reload matching data. How can I remove or delete records for a given resource from a custom inventory table?

Answer
 

If you only want to delete data for one resource, the following query can help. To delete records for a single resource from a custinv table:

-- @rguid is the _resourceguid for the client computer
-- @dcguid is the dataclass guid. It can be found in various ways, including:
--    select * from dataclass where name = '<dataclass name>'
DECLARE @rguid varchar(36)
DECLARE @dcguid varchar(36)
DECLARE @custtablename varchar(256)

set @rguid = ‘???’
set @dcguid = '???'
set @custtablename = ‘???’

delete from @custtablename where _resourceguid = @rguid
delete from resourceupdatesummary 
  where resourceguid = @rguid 
    and inventoryclassguid = @dcguid


Legacy ID



34440


Article URL http://www.symantec.com/docs/HOWTO7225


Terms of use for this information are found in Legal Notices