title: Concatenate row record base on group by in SQL Server 2008
body: <p>I have one table (tblproduct) with fields: dept, product, qty.
  sample data below:</p>
  
  <pre><code>dept    product qty
  IT  A   2
  IT  B   1
  PU  C   4
  SAL D   1
  SER D   2
  SER A   4
  </code></pre>
  
  <p>I want to create stored pro in sql server with the result below:</p>
  
  <pre><code>product qty remark
  A   6   IT=2,SER=4
  B   1   IT=1
  C   4   PU=4
  D   3   SAL=1,SER=2
  </code></pre>
  
  <p>this is my stored pro</p>
  
  <pre><code>select product,
         sum(qty)
  from tblproduct
  group by product
  order by product
  </code></pre>
  
  <p>Pls. any help. thanks.</p>