title: mariadb declare variable syntax error
body: <p>Im using mariadb with heidisql to execute sql:</p>
  
  <p>DECLARE @AccountID INT;</p>
  
  <p>Insert Into accounts(first_name, mi, last_name, email, is_admin, is_enabled, date_created)
  Values('testfirstname', 'a', 'testlastname', 'user@email.com', 1, 1, NOW());</p>
  
  <p>set @AccountID = Last_Insert_Id();</p>
  
  <p>I keep getting an error:</p>
  
  <p>QL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@AccountID INT' at line 1 */</p>
  
  <p>I was looking at the usage of Declare but it says that its used in a Function.  Ive tried with a BEGIN/END before the DECLARE and after with the same error.<br>
  I new to the mysql syntax where this would work in sql server.  so if anyone can let me know what i got wrong it would be appreciated.</p>
  
  <p>Thanks</p>