title: Using a Blob Column in this Query Requires that the Query Subject Must Have Either a Key or a Unique Index
body: <p>I have the following code:</p>
  
  <pre><code>SELECT  boo_event 'Orden de Trabajo' ,STUFF((SELECT ', ' + CAST(boo_person AS VARCHAR(100)) [text()]    
      FROM R5BOOKEDHOURS 
      WHERE boo_event = t.boo_event
      FOR XML PATH(''), TYPE).value('.','NVARCHAR(MAX)'),1,1,' ') Empleados , STUFF((SELECT ', ' + CAST(boo_hours AS VARCHAR(100)) [text()]       
      FROM R5BOOKEDHOURS 
      WHERE boo_event = t.boo_event
      FOR XML PATH(''), TYPE).value('.','NVARCHAR(MAX)'),1,1,' ') Horas
      FROM R5BOOKEDHOURS t
      GROUP BY boo_event
  </code></pre>
  
  <p>And it works perfectly on SQL Server Studio, but when I'm trying to use it on COGNOS Reporting Studio, I'm getting this error:</p>
  
  <p><em>-- Using a Blob Column in this Query Requires that the Query Subject Must Have Either a Key or a Unique Index --</em></p>
  
  <p>I'm not sure if it's just an error with that tool, or something we could fix changing the code a bit.</p>