title: How to convert multiple rows into one row with multiple columns using Pivot in SQL
body: <p>I have a log file that comes in as 1 column and each record consist of multiple rows. Each record is delimited by an empty(blank) row. How can I move each row of record into its own column(s) and I have to do it dynamically? Be gentle...im very new.
  </p>
  
  <pre><code>Column1
  ----------------------------
  **empty row -Begin Record 1
  row1data1
  row1data2
  row1data3
  **empty row -Begin Record 2
  row2data1
  row2data2
  row2data3
  NULL
  row2data5
  **empty row - Begin Record 3
  .
  .
  .
  </code></pre>
  
  <p>The results I would like:</p>
  
  <pre><code>Column1     Column2     Column3     Column4   Column5    
  ----------------------------------------------------
  row1data1   row1data2   row1data3    
  row2data1   row2data2   row2data3   NULL      row2data5
  .
  .
  .
  </code></pre>
  
  <p>Thanks in advance!</p>