My Execute SQL Task has OLE DB Connection to master table as initial catalog;
SQL statement is CREATE DATABASE ?;
BypassPrepare->true
Parameter Maping, Variable Name->User::InitialCatalog, Direction->Input, Data Type->NVARCHAR, Parameter Name->0, ParameterSize->20;
Variable User::InitialCatalog is of type string with initial value set as Project3;
So, it should be executed CREATE DATABASE Project3;
I get an error [Execute SQL Task] Error: Executing the query "CREATE DATABASE ?;" failed with the following error: "Incorrect syntax near '@P1'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters
not set correctly, or connection not established correctly.
If i try to execute CREATE DATABASE Project3 without parameters, it works.
As i understand it just change CREATE DATABASE ?; with name of parameter CREATE DATABASE @P1; but not with value of parameter CREATE DATABASE Project3; as it should be.
Please help.