title: SQL: How to Transform rows to column in TSQL
body: <p>Here is table structure, and sample data</p>
  
  <pre><code>create table #tmp ( Id int, Name varchar(100))
  insert into #tmp (Id,Name)
  Values (1,'Add')
  insert into #tmp (Id,Name)
  Values (2,'Update')
  
  insert into #tmp (Id,Name)
  Values (3,'Delete')
  </code></pre>
  
  <p>and expected result should be.</p>
  
  <pre><code>Add  Update  Delete
  ===  ======  ======
  1    2       3
  </code></pre>