Regards,
HenkI don't think you can, and I also don't think it should matter. Why would you want this?|||Well, during validation I want to access a package level variable that is filled with a lookup table by a preceding task. However, at designtime, there is no such thing as a task that has executed previously, so the variable does not exist then.
|||Should the variable not exist, but the value may be rubbish? You cannot create variables at run-time (... I'm pretty sure you can't, no run-time structure changes allowed in SSIS). If something is really missing I think you are perhaps digging too deep into the validation, unless it is only certain settings that induce this issue.
The way to get round this would be to set DelayValidation to true, so validation only happens at runtime.
You would do this for a Exec SQL Task that requires a table for created by a preceeding task, such that the table will not exist until part through run-time. Normally it is good to validate the SQL, but in this case it will cause a problem, so we can bypass validation.|||
DarrenSQLIS wrote: You cannot create variables at run-time
I'm afraid I didn't make myself clear. I do not create variables at runtime.
But is my observation correct that if you define a variable (at designtime of course!) at package level, that variable is not seen by custom components in a dataflow task in that packge until executiontime\runtime? (so it doesn't even contain rubbish, but it just isn't there)
(By the way I can easily get around the fact that I can't detect designtime or executiontime, so that's no issue anymore)|||
Henk v J. wrote: that variable is not seen by custom components in a dataflow task in that packge until executiontime\runtime
You sure? I have a component that uses variables, actually the variable name is a property value, and I validate that the variable selected does exist. This works at design-time calls to Validate.
Henk v J. wrote: By the way I can easily get around the fact that I can't detect designtime or executiontime, so that's no issue anymore)
Don't be shy. I'm intrigued now, what have you done?
By the way you are probably right about, because I can't see the variable at runtime either, so there is something else wrong... I post a separate issue on that.
Thanks for your reactions!|||Ok, I lied I don't use variables in Validate, but I do in AcquireConnections, so still in a component, and that is called during design and execution times.
if (VariableDispenser.Contains(location))
{
IDTSVariables90 vars = null;
VariableDispenser.LockOneForRead(location, ref vars);
return vars[0].Value.ToString();
}
No comments:
Post a Comment