title: Are Parameters really enough to prevent Sql injections?
body: <p>I've been preaching both to my colleagues and here on SO about the goodness of using parameters in SQL queries, especially in .NET applications. I've even gone so far as to promise them as giving immunity against SQL injection attacks.</p>
  
  <p>But I'm starting to wonder if this really is true. Are there any known SQL injection attacks that will be successfull against a parameterized query? Can you for example send a string that causes a buffer overflow on the server?</p>
  
  <p>There are of course other considerations to make to ensure that a web application is safe (like sanitizing user input and all that stuff) but now I am thinking of SQL injections. I'm especially interested in attacks against MsSQL 2005 and 2008 since they are my primary databases, but all databases are interesting. </p>
  
  <p>Edit: To clarify what I mean by parameters and parameterized queries. By using parameters I mean using "variables" instead of building the sql query in a string.<br>
  So instead of doing this: </p>
  
  <pre><code>SELECT * FROM Table WHERE Name = 'a name'
  </code></pre>
  
  <p>We do this:</p>
  
  <pre><code>SELECT * FROM Table WHERE Name = @Name
  </code></pre>
  
  <p>and then set the value of the @Name parameter on the query / command object.</p>