title: Declaring mysql variables inside a heidisql query tab
body: <p>I have declared a variable in a heidisql tab like this</p>
  
  <pre><code>DECLARE total_count INT DEFAULT 0;
  SET total_count = 10;
  select total_count;
  </code></pre>
  
  <p>but i get this error</p>
  
  <blockquote>
    <p>/* SQL Error (1064): You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near 'DECLARE total_count INT DEFAULT 0' at line 1 <em>/ /</em>
    Affected rows: 0  Found rows: 0  Warnings: 0  Duration for 0 of 3
    queries: 0.000 sec. */</p>
  </blockquote>
  
  <p>Should i be declaring ,setting and using the variable like i have done or must i wrap everything inside a stored procedure or a function?.</p>