title: Script task inside a SSIS For Each loop - writing to a file
body: <p>My script task is inside a SSIS for each loop. I want the script task to write some dynamic string to one file only for all iterations. After every iteration, the file should get appended, not overwritten with the current value of the dynamic string. Its like a logging "tool". Btw, SSIS is SQL server integration services, an ETL tool.</p>
  
  <p>How do I do this ?</p>
  
  <p>I tried using a script, but it seems to be overwriting the file with the dynamic string. I don't want that. I want it to be appended to the file instead. </p>
  
  <p>Here is the script which is inside my for each loop - </p>
  
  <pre><code>String text = "My text here";
  String path = @"C:\Data\TextFiles\logFile.txt";
  StreamWriter file = new StreamWriter(path, true);
  file.WriteLine(text);
  file.Close();
  </code></pre>