Exec SQL Tasks support parameters, but this is OLE-DB parameter support,
which is similar to that in T-SQL, so as rule of thumb if you cannot use a
local variable in T-SQL then you can't in the task either. A database name
for a CREATE DB statement cannot be a parameter. In T-SQL you would use
dynamic SQL, but parameters don't work with this very well in the task. The
way to do this is use an ActiveX Script Task to prepare the SQL Statement in
advance and then set it.
Use the Dynamic Properties task to read the new DB name into global
variable.
Use an ActiveX Script Task to build the CREATE DB command, and set the
SQLStatement property of the Exec SQL Task.
Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)
--
Darren Green
http://www.sqldts.com
http://www.sqlis.com
"Hans - DiaGraphIT -" <HansDiaGraphIT (AT) discussions (DOT) microsoft.com> wrote in
message news:6BD583F2-6E68-4711-BF34-667ADE76CAFA (AT) microsoft (DOT) com...
Quote:
Hi!
this is my case. I have an ini-file containing info about server
location,
password and database name. My "dynamic properties task" reads from the
ini-file and the specified values. My next step is a SQL Execute task
where
I want to create a database based on the name from the ini-file. How do I
get this value in to my SQL statement?
Any help or Idea?
Best regards
--------------------
Hans |