title: What is dynamic SQL?
body: <p>I just asked an SQL related question, and the first answer was: "<em>This is a situation where dynamic SQL is the way to go.</em>"  </p>
  
  <p>As I had never heard of <strong>dynamic SQL</strong> before, I immediately searched this site and the web for what it was. Wikipedia has no article with this title. The first Google results all point to user forums where people ask more or less related questions.  </p>
  
  <p>However, I didn't find a clear definition of what a 'dynamic SQL' is. Is it something <strong>vendor specific?</strong> I work with <strong>MySQL</strong> and I didn't find a reference in the MySQL handbook (only questions, mostly unanswered, in the MySQL user forums).</p>
  
  <p>On the other hand, I found many references to <strong>stored procedures</strong>. I have a slightly better grasp of what stored procedures are, although I have never used any. How are the two concepts related? Are they the same thing or does one uses the other? </p>
  
  <p>Basically, what is needed is a simple introduction to <em>dynamic SQL</em> for someone who is new to the concept.</p>
  
  <p>P.S.: If you feel like it, you may have a go at answering my previous question that prompted this one: <a href="https://stackoverflow.com/questions/4164808/sql-how-can-we-make-a-table1-join-table2-on-a-table-given-in-a-field-in-table1">SQL: How can we make a table1 JOIN table2 ON a table given in a field in table1?</a></p>