Friday 29 November 2013

SQL Script to pull the Group Name and respective members of the Group

SELECT b.GroupName, c.[DisplayName]
FROM dbo.BASUserGroupMembershipV a left join dbo.BASGroupNamesV b on a.[GroupId] = b.[GroupId]
                                                      left join dbo.UserConfig c on a.UserConfigId = c.[Id]
                                                      Where a.GroupId = '4'
UNION
SELECT b.GroupName, c.[DisplayName]
FROM dbo.BASUserGroupMembershipV a left join dbo.BASGroupNamesV b on a.[GroupId] = b.[GroupId]
                                                      left join dbo.UserConfig c on a.UserConfigId = c.[Id]
                                                      Where a.GroupId = '5'

No comments:

Post a Comment