title: PIVOT / UNPIVOT in SQL Server 2008
body: <p>I got child / parent tables as below.</p>
  
  <p>MasterTable:</p>
  
  <pre><code>MasterID, Description
  </code></pre>
  
  <p>ChildTable</p>
  
  <pre><code>ChildID, MasterID, Description.
  </code></pre>
  
  <p>Using PIVOT / UNPIVOT how can i get result as below in single row.</p>
  
  <p>if (MasterID : 1 got x child records)</p>
  
  <pre><code>MasterID, ChildID1, Description1, ChildID2, Description2....... ChildIDx, Descriptionx
  </code></pre>
  
  <p>Thanks</p>