title: Export table from database to csv file
body: <p>I want to:
  Export table from sql server database to a comma delimited <code>csv</code> file without using sql Server import export wizard</p>
  
  <p>I want to do it using a query because I want to use the query in automation</p>
  
  <p>Is it possible? I searched for that and didn't find a good answer</p>