I would think that this wouldn't be a complex thing, but I guess I'm wrong.
I want to create tables in a database based upon a string created by input variables including a parent ID.
My Code:
-- create table named the value in @newname
SELECT CONCAT('Entity_', @@IDENTITY) into @newname;
CREATE TABLE IF NOT EXISTS @newname LIKE entity_id;
I get:
Error Code: 1064. You have an error in your SQL syntax;
It complains about the @newname.
Any suggestions?