title: How can I use SSIS to add an extra column containing the value of an incremented variable into my destination table?
body: <p>I have this SSIS workflow defined.  After I explain what I'm doing, it might be possible my approach is wrong, as this is my first "real" SSIS package.</p>
  
  <p><img src="https://i.stack.imgur.com/djrIN.png" alt="enter image description here"></p>
  
  <p>To increment the counter I do this:</p>
  
  <pre><code>public void Main()
  {
      int i = Convert.ToInt32(Dts.Variables["User::DayCounter"].Value.ToString());
      i++;
      Dts.Variables["User::DayCounter"].Value = i;
  
      Dts.TaskResult = (int)ScriptResults.Success;
  }
  </code></pre>
  
  <p>My destination table currently looks like this:</p>
  
  <pre><code>PID Campaign Name   Company Impr    Clicks  Clickthru   Leads   View-Through Leads  # Sales # View-Through Sales    Sales   View-Through Sales  Sub Sales   View-Through Sub Sales  We Get  They Get    Revenue EPC S U R T Active  SourceFile
  1734    US - Lending Tree Refinance Mortgage - DA 3 Page SSN    Tree.com    58  2,053   3,539.66%   201 0   0   0    0.00    0.00    0.00    0.00    8044.02     5846.00     2198.02     2.85   10% Yes Active  \\ad1\Marketing\Aaron\DirectTrackAutomatedReports\admin_program_stats_20120229.csv
  </code></pre>
  
  <p>My goal is simply to add a column called <code>Day</code> to the report, containing the value of the counter variable.</p>