title: How to Export Data From SQL Server to CSV File using sql statement
body: <p>So what i am trying to do is using query inset data in CSV file with headers i know this not the right way i also tried using "bcp" on sql but it spiking the headers as well putting everything in one column </p>
  
  <pre><code>bulk insert "C:\New folder\s.csv"
  from [D].[user]
  with (fieldterminator = ',', rowterminator = '\n')
  go
  </code></pre>
  
  <p>Sources should be sql Query 
  Output result should be a .CSV file with Headers </p>