test.sql:
SET @my_var = 50;
CREATE TABLE test_table (
    id SMALLINT NOT NULL,
    my_text VARCHAR(@my_var),
    PRIMARY KEY (id)
);
Command line interaction:
mysql> source d:/test.sql;
Query OK, 0 rows affected (0.00 sec)
ERROR 1064 (42000): 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
'@my_var),
    PRIMARY KEY (id)
)' at line 3
Is there a way to do this?
 
    