title: .SQL files in visual studio 2012
body: <p>I have an question about executin of sql commands from visual studio, I have a few procedures which are not so short so it would be a drag if i execute them with comandtype text and write it with stringbuilder. I decided to write them in .sql file that is saved in my project but i dont know much about it. Like if there is created procedure, I assume i need to make it once but how to call it then later after for something else etc. when user clicks i need to call it with various parameters. Any tutorials or examples about it?<br>
  Something like </p>
  
  <pre><code>FileInfo file = new FileInfo(@"\\ares\c$\Inetpub\wwwroot\TestArea\SQL\testsql.sql");
  
  
          string script = file.OpenText().ReadToEnd();
  
  
          using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["WhatIfDatabaseConnectionString"].ConnectionString))
          {
                SqlCommand sqlCmd = new SqlCommand(script, conn);
                sqlCmd.ExecuteNonQuery(script);
  </code></pre>
  
  <p>But with parameters.</p>