Asset Management Suite

 View Only
  • 1.  [AMS] Issues building sql query asset report with custom assets

    Posted Oct 22, 2019 12:17 PM

    Hello everyone,

    I've create a couple of custom assets (e.g. datacenter data class with two rows).

    After creating a association and assign it to a Computer Asset, all i see is duplicated rows for this computers associated: a correct one field with a NULL one).

     

    Anybody knows why this happens? I see duplicated fields. My query is below so you can check is ok.

    select distinct
        vComputer.Name
        ,Inv_Datacenter.[datacenter-name]
    from 
        vComputer
            left join ResourceAssociation 
                on vComputer.Guid = ResourceAssociation.ParentResourceGuid
            left join Inv_Datacenter
                on ResourceAssociation.ChildResourceGuid = Inv_Datacenter._ResourceGuid
            --left join dbo.vHWComputerSystem 
            --    on vComputer.Guid = dbo.vHWComputerSystem._ResourceGuid
    --where [datacenter-name] is not null
    order by
        vComputer.Name

     

    Thanks for the response.

     



  • 2.  RE: [AMS] Issues building sql query asset report with custom assets

    Broadcom Employee
    Posted Oct 22, 2019 12:35 PM

    If you query only "Inv_Datacenter", is there duplicate records?

    SELECT * FROM Inv_Datacenter



  • 3.  RE: [AMS] Issues building sql query asset report with custom assets

    Posted Oct 22, 2019 12:43 PM

    Actually, there's only unique rows. and matches each GUID also.



  • 4.  RE: [AMS] Issues building sql query asset report with custom assets

    Posted Oct 23, 2019 05:54 AM

    If you bring back the RATG (ResourceAssociationTypeGuid) what does it show for each record?

    I usally add an extra AND to my LEFT JOIN

    LEFT JOIN ResourceAssociation ra ON ra.ParentResourceGuid = c._ResourceGuid AND ra.ResourceAssociationTypeGuid = 'RA GUID' --RA Name



  • 5.  RE: [AMS] Issues building sql query asset report with custom assets

    Posted Jan 18, 2021 05:46 AM
    Edited by Debbie Sassine Jan 19, 2021 01:15 AM
    Click on to expand the folders to where the existing custom SQL report is at, or clone an out of box report, or create a new SQL report.

    GarageBand PC