title: SQL query to flatfile csv with column header, separator column ";" and text qualifier double-quote
body: <p>I would like export SQL query to csv flatfile in ExecuteProcessTask in SSIS.</p>
  
  <p>I can't see an export with the header, separator and qualify it as text.
  I tried with sqlcmd and bcp.</p>
  
  <p>For information, I am obliged to use a SELECT * because the view in FROM is a variable and I have to display all the column.</p>
  
  <p>With sqlcmd :</p>
  
  <pre><code>sqlcmd -S  ServerName -d dbName -E -Q "SELECT * FROM vPBI_Tasks WHERE [project Leader] like 'ProjectLeaderName'" -o "exportFile.csv" -W -s";"
  </code></pre>
  
  <p>Extract Result :</p>
  
  <pre><code>Scope;Project type;Activity type;OBS;Customer;Contr...
  -----;------------;-------------;---;--------;-----...
  ESP;ESP - Amendment;NULL;NULL;GSA;ESP_Amendment#13;...
  ESP;ESP - Amendment;NULL;NULL;GSA;ESP_Amendment#13;...
  ESP;ESP - Amendment;NULL;NULL;GSA;ESP_Amendment#13;...
  </code></pre>
  
  <p>I would like :</p>
  
  <pre><code>"Scope";"Project type";"Activity type";"OBS";"Customer";"Contra..."
  ESP";"ESP - Amendment";"NULL";"NULL";"GSA";"ESP_Amendment#13";""
  ESP";"ESP - Amendment";"NULL";"NULL";"GSA";"ESP_Amendment#13";""
  ESP";"ESP - Amendment";"NULL";"NULL";"GSA";"ESP_Amendment#13";""
  </code></pre>
  
  <p>With bcp :</p>
  
  <pre><code>bcp "SELECT * FROM vPBI_Resources WHERE [project Leader] like 'ProjectLeaderName'" queryout "exportFile.csv" -c -t ; -S ServerName -T
  </code></pre>
  
  <p>Result :</p>
  
  <ul>
  <li>I don't have header</li>
  <li>I don't have text qualifier</li>
  </ul>