I pass variable to execute sql task for create table in ssis package but show error

I pass variable to execute sql task for create table in ssis package but show error. command= "CREATE TABLE ? (ID int , FirstName nvarchar(50) , LastName nvarchar(50))"

It's "Parameter Mapping" used in Execute SQL Task

The root problem is that you cannot parameterize a table (or column) name using the Parameter mapping as shown.
Instead, the way to make a dynamic table creation work is to use Expressions on SSIS Variables. Good old fashioned string concatenation to build up your
CREATE TABLEstatement and then theSQLSourceTypefromDirectInputto fromVariableCreate a new SSIS Variable of type string. I'm going to call it
QueryTableCreateIn the Expression column, click the ellipses...and in the popup window, use the followingClicking Evaluate Expression should yield
If you are also building out the columns dynamically, I would strongly encourage the creation of an SSIS Variable
ColumnDeclarationwhich would then make the original expression intoThe benefit as I see it of this approach is that you can easily test/verify the value of your dynamic statement outside of the component and easily swap pieces in and out as your queries get more complex.
Not addressed here but things you should consider based on your use case
[]to ensure valid object names