title: Create varchar from SELECT result
body: <pre><code>DECLARE @result varchar(MAX)
  
  SELECT 
    NAME
  FROM
    Table
  WHERE
    ID = @Id
  </code></pre>
  
  <p>I need to fill <code>@result</code> with result Names, separated by ','.<br>
  For example, if <code>SELECT</code> returns 'A','B' and 'C', the <code>@result</code> should be 'A, B, C'.<br>
  It is Microsoft SQL Server 2008.</p>