0

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?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.