title: Divide a main table into multiple tables using SQL server
body: <p>I am trying to create multiple tables out of a main table in SQL server.
  e.g.: </p>
  
  <p>The main table looks like</p>
  
  <pre><code>A 1
  A 2
  A 3
  B 4
  B 5
  B 6
  </code></pre>
  
  <p>The output should look like :</p>
  
  <p>Table A:</p>
  
  <pre><code>A 1
  A 2
  A 3
  </code></pre>
  
  <p>Table B:</p>
  
  <pre><code>B 4 
  B 5 
  B 6
  </code></pre>
  
  <p>The main table is updated every week so can have different alphabets. So I want to create a dynamic query that will automatically divide the main table into 'n' different tables depending on how many different n's are there and also name the table based on the n<sup>th</sup> value.</p>