Yes, but that's not the solution I would suggest. It sounds to me like
you're trying to load up all the records for export into a DataTable
to then use the simplistic WriteAll method of CsvWriter. I would
instead suggest you just create a SqlDataReader using your select
statement or stored proc and then loop over it and for each record in
the SqlDataReader, loop over each column and output the value. This
will scale to any size resultset and not require any memory usage at
all during export.
To answer your original question, instead of using the CsvWriter
constructor that takes a file name parameter, use the constructor that
takes a StreamWriter object and use the constructor of StreamWriter
that takes a parameter for whether or not to append to an existing
file. These combined together will allow you to open another CsvWriter
instance to append to the existing file.
http://www.csvreader.com/csv/docs/DataStreams.Csv.CsvWriterConstructor3.html
http://msdn.microsoft.com/en-us/library/36b035cb.aspx
Bruce Dunwiddie