• The function CombineGroupNames can be dispensed with entirely by defining the view thus:

    CREATE View [dbo].[ApplicationResources]

    AS

    SELECT R.[ResourceName]

    ,R.[IsEnabled]

    ,replace(replace(replace( (

    SELECT '['+sg.GroupName +']'

    FROM ResourceSecurityGroup rsg

    JOIN SecurityGroup sg ON rsg.GroupID=sg.GroupID

    WHERE rsg.ResourceID=R.ResourceID

    ORDER BY GroupName

    FOR XML PATH('') ), '][', '|'), '[', ''), ']', '') as 'Groups'

    FROM dbo.Resource R

    Of course, with such as small dataset it's difficult to determine what's most efficient, but getting rid of the cursor is always a good idea.

    [Edit] BTW, I agree with the comments that 'in the real world' it would probably not be worthwhile to do this on such a small dataset, but it does serve as a good example of a workaround to a problem where the vendor won't fix what may be an obvious problem. In fact, I've used similar workarounds (creating views for old tables) when a large application needs various tables restructuring but resource meant that all sections of the application couldn't be changed to use the new structure in one go.

    Derek