Converting MSSQL Stored Procedure to MySQL - Syntax Error
Comment from @ypercube is correct -- in this case, the syntax error you're encountering is because the previous line did not end in a semicolon:

Declare RowID, CountAll INT DEFAULT 0


Should be:

Declare RowID, CountAll INT DEFAULT 0;


In MySQL's stored procedure language, you have access to two different types of variables. 


The first you declare with DECLARE and these are locally scoped to the procedure. Do not prefix these with @.
The second type of variable are called user variables and they are prefixed with @. You don't have to declare these. But they are kind of like "global" variables in that they are scoped to the session, and you can assign and read them outside the procedure. That is, you could assign a value to one of these variables in the procedure, and then after the procedure is done, you could read that user variable in any SQL expression.


In your procedure, you also have some input arguments. These are treated like the first type of variable. They are locally scoped, and they don't use the @ prefix. For example, you have an input argument UserID but this is not the same variable as @UserID that you use in your query.

This brings up the possibility of ambiguity when your variables have the same names as columns, and you try to use the variables to compare to the columns. MySQL does its best to have rules for precedence, but it is far easier to debug if you make sure your local variable names don't use the same names as columns.



Other issues:


This line:

SELECT @RowID := @@Identity;


Should be as follows in MySQL:

SET @RowID = LAST_INSERT_ID();

Comments starting with -- must have a space following them, which is non-ANSI but is meant to resolve syntax ambiguity. E.g., this:

--User


Must be changed to:

-- User