title: Repeated column values as column header in SQL server
body: <p>I have a table like this.</p>
  
  <pre><code>--------------------------------
  File      File 
  Name      Stage    Time
  ---------------------------------
  Arun    Start   01-07-2010
  Ajit    Middle  07-01-2010
  Paddu   Start   14-12-2010
  Manu    End     23-06-2010
  Ajit    End     08-01-2010
  Paddu   Middle  16-12-2010
  Arun    Middle  05-07-2010
  Ajit    Archive 12-01-2010
  Paddu   End     18-12-2010
  Manu    Archive 25-06-2010
  Paddu   Archive 20-01-2011
  Arun    End     09-11-2010
  ---------------------------------
  </code></pre>
  
  <p>I want the output as </p>
  
  <pre><code>---------------------------------------------------
  File 
  Name    Start       Middle      End         Archive
  ---------------------------------------------------
  Arun    01-07-2010  NULL        NULL        NULL
  Ajit    NULL        07-01-2010  NULL        NULL
  Paddu   14-12-2010  NULL        NULL        NULL
  Manu    NULL        NULL        23-06-2010  NULL
  Ajit    NULL        NULL        08-01-2010  NULL
  Paddu   NULL        16-12-2010  NULL        NULL
  Arun    02-07-2010  05-07-2010  NULL        NULL
  Ajit    NULL        NULL        NULL        12-01-2010
  Paddu   NULL        NULL        18-12-2010  NULL
  Manu    NULL        NULL        NULL        25-06-2010
  Paddu   NULL        NULL        NULL        20-01-2011
  Arun    NULL        NULL       09-11-2010   NULL
  ---------------------------------------------------
  </code></pre>