Asset Management Suite

 View Only
  • 1.  SQL statement to find users without assigned assets

    Posted Mar 09, 2011 10:08 AM

    Hi All

    Anyone who know a SQL statement for producing a report that can display the following.

    vUser.Guid, vUser.name

    The users I need to find, are users which have no asset assigned to them.

    BR bkc



  • 2.  RE: SQL statement to find users without assigned assets

    Posted Mar 14, 2011 07:01 PM

     

    declare @raAssetUserOwners uniqueidentifier
    set @raAssetUserOwners = 'ED35A8D1-BF60-4771-9DDE-092C146C485A'
     
    select
    u.Name,
    u.Guid
    from
    vUser u
    left join ResourceAssociation ra on u.Guid = ra.ChildResourceGuid and ra.ResourceAssociationTypeGuid = @raAssetUserOwners
    left join vRM_Asset a on ra.ParentResourceGuid = a.Guid and a.Deleted = 0
    where
    ra.ChildResourceGuid is null
    order by
    u.Name