There are apparently some obnoxious restrictions in the SA database engine:
Host variable references are permitted within batches with the following restrictions:
- only one statement in the batch can refer to host variables
- the statement which uses host variables cannot be preceded by a statement which returns a result set
One possible workaround is selecting all host variables (parameters) into local variables in one statement before using them:
BEGIN
DECLARE @id INT;
DECLARE @name NVARCHAR;
DECLARE @comment NCARCHAR;
SELECT :id, :name, :comment INTO @id, @name, @comment;
END;