title: Is it better to write sql query as a stored procedure or write it inside C# and execute it dynamically
body: <p>What I mean is if I have two ways to write a SQL query:</p>
  
  <ol>
  <li><p>write it inside SQL as a stored procedure and execute it from C# </p></li>
  <li><p>build a query in C# then execute the query so it does not exist in my database </p></li>
  </ol>
  
  <p>Which is better and why?</p>