Symantec Developer Group

 View Only
Expand all | Collapse all

Custom Inventory Reporting - How do I add more new parameters to a SQL based Report?

  • 1.  Custom Inventory Reporting - How do I add more new parameters to a SQL based Report?

    Posted Aug 14, 2015 05:34 AM


  • 2.  RE: Custom Inventory Reporting - How do I add more new parameters to a SQL based Report?

    Posted Aug 14, 2015 05:59 AM

    Hi There,

    I have to build a custom inventory report that populates a set of hardware/software information from a list of managed servers defined in filter but I was stuck and heading no way to get the right results. Here is the custom SQL query downloaded from forum which I would like to add the following parameters:

    - To display Domain, OS Name, OS version, Hardware manufacturer, Created Date, & Last Full Inventory Sent to NS 

    -- CollectionMembership
    -- Show resource in a filter

    declare @filterGuid uniqueidentifier
    --set @filterGuid = 'eb3a1a12-e1c7-4431-b060-f0333e4e488c' -- All Computers
    set @filterGuid = '%FilterGuid%'

    declare @ResourceName nvarchar(max)
    --set @ResourceName = '' -- 'pc' -- '%ResourceName%' --
    set @ResourceName = '%ResourceName%'

    select vr2.Guid [_ItemGuid], vr2.Name [Resource], vi1.Name [Collection]
    from  vResourceEx vr2

    inner join CollectionMembership cm
        on cm.CollectionGuid = @filterGuid
        and cm.ResourceGuid = vr2.Guid

    left join vItem vi1 on vi1.Guid = cm.CollectionGuid

    where  (@ResourceName=''  or vr2.Name like '%'+@ResourceName+'%' )

    order by vi1.Name, vr2.Name