export const userCheck = `
SELECT *,
	'[' + STUFF((
        SELECT ',' + '"' + REPLACE(REPLACE(ur.name, '\', '\\'), '"', '\"') + '"'
        FROM [test1_AlplaPROD2.0_Read].[user].[Roles] (nolock) ur
        WHERE ur.userid = u.id
        FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'
    ), 1, 1, '') + ']' AS roles,
	'[' + STUFF((
        SELECT ',' + cast(ulr.roleid as nvarchar(max))
        FROM [test1_AlplaPROD2.0_Read].[user].[LegacyRoles] (nolock) ulr
        WHERE ulr.userid = u.id
        FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'
    ), 1, 1, '') + ']' AS legacyRoles
  FROM [test1_AlplaPROD2.0_Read].[user].[User] (nolock)  u
  where Loginname = '[userName]'
`;
