title: Save Query Result as csv file on server under specific folder
body: <p>I want to save sql server 2008 query result to server itself and store file link in another table so whenever i want i can download the file, without re executing the query.</p>
  
  <p>I am using asp.net with C# as front end.</p>
  
  <p>in front end it is like. <code>Enter Area Code</code><br>
  user enters area code and click on submit, it will search all record with the same area code in database and save it in csv file on server.</p>
  
  <p>i am using following code.</p>
  
  <pre><code>select * from mytablename where area_code=21
  </code></pre>
  
  <p>save this result on my server.</p>