INSERT INTO VCLib.T_ROLE_CLIENT_MODULES
           (RoleClientModuleID
           ,LoadOrder
           ,ClientModuleID
           ,RoleID)
SELECT
           gen_random_uuid()--<RoleClientModuleID, uniqueidentifier,>
          ,rcm.LoadOrder--<LoadOrder, int,>
          ,(select ClientModuleID from VCLib.T_CLIENT_MODULES where ModuleType = 'Custom_DnFondClientModule')--<ClientModuleID, uniqueidentifier,>
          ,rcm.RoleID--<RoleID, uniqueidentifier,>)
from VCLib.T_ROLE_CLIENT_MODULES rcm
    join VCLib.T_CLIENT_MODULES cm on cm.ClientModuleID = rcm.ClientModuleID
where cm.ModuleType = 'DnFondClientModule'
        and
    not exists
    (
        select *
        from VCLib.T_ROLE_CLIENT_MODULES rcm1
            join VCLib.T_CLIENT_MODULES cm1 on cm1.ClientModuleID = rcm1.ClientModuleID
        where rcm1.RoleID = rcm.RoleID
                and
            cm1.ModuleType = 'Custom_DnFondClientModule'
    )
