title: SQL Distinct comma delimited list
body: <p>I am trying to create a comma delimted list of names in a table using the below query</p>
  
  <pre><code>DECLARE @listStr VARCHAR(MAX)
  SELECT @listStr = COALESCE(@listStr+',' ,'') + Name
  FROM Production.Product
  SELECT @listStr
  </code></pre>
  
  <p>This works fine, however the list does contain duplicates</p>
  
  <p>Can anyone advise how I would make this <code>DISTINCT</code> so the list does not contain duplicates.</p>