title: SSIS - export from SQL table to multiple flat files based on first column values
body: <p>Here is an example of what the SQL Table looks like:</p>
  
  <pre><code>Name    Class   Grade
  Jesse   English A
  Jesse   Math    C
  Jesse   History A
  Scott   Math    B
  Scott   History B
  Scott   English A
  Mike    History A
  Mike    English D
  </code></pre>
  
  <p>I am trying to get SSIS to dynamically create a flat file for each person. Example:</p>
  
  <p>Flat File name: <strong>Jesse</strong></p>
  
  <pre><code>Name    Class   Grade
  Jesse   English A
  Jesse   Math    C
  Jesse   History A
  </code></pre>
  
  <p>Flat File name: <strong>Scott</strong></p>
  
  <pre><code>Name    Class   Grade
  Scott   Math    B
  Scott   History B
  Scott   English A
  </code></pre>
  
  <p>Flat File name: <strong>Mike</strong></p>
  
  <pre><code>Name    Class   Grade
  Mike    History A
  Mike    English D
  </code></pre>
  
  <p>I can easily create a static link between the sql table and the flat file but I plan on adding a lot of people to the table which would otherwise cause me to create a data flow task for each.  This would not be ideal.  I was hoping for a for each loop that identified the distinct values within the Name column and then output the qualified rows into a flat file.  </p>