1) User::vendorId Int32 Initial value = -1
2) User::vendorName String Initial value = Vendor A
I make the assignment in the Variable pane. Are there any other ways of doing this?
Watching the two variables reveals that only the value for the first variable is carried over during execution. The vendorname is always blank --> {}. I'm using a SQL Task with OLEDBConnection.
What's going on here?
Carried over during execution? What do you mean?
Is this a real problem or an issue with the diagnosis method. When watching variables, you must be on a breakpoint, and you must examine them in the watch window. Looking at the variables pane or looking when not on a breakpoint may not give you the correct value, as only the watch window at a breakpoint is updated during execution. Is a bit fussy, as you can see the value in several other windows, but they just do not get updated.
|||When you create a variable and assign it a default, that value never changes. During execution it can change, but when the package is done all variables revert back to the defaults you entered when you created the package.|||"revert back to the defaults" - think of it this way, when you execute a package the execution host loads it, then executes it and then does not save it. The execution host and the designer are two different things, albeit with some communication for the debug features. This is a change to the DTS behaviour if that is in your background.|||Guys thanks so much for th replies. I'm still in the development phase obviously and I just want the flexibility of setting values to the package variables. For this, I use the Variable pane of Visual Studio where the last column - I think - is for the default value to be used on every run. I tried to use the Script task but I couldnt find my package variables. My vendorId which is initialized to -1 retains its value during the execution; at least that's what the Watch window is showing me. The other variable User::vendorName is always blank even if I set it to a certain string value prior to F5. My control flow doesnt have any event handler. Should you need more clarification guys, I'll do everything to make this clear.|||Just to clarify, if you change the Value property for the variable in the Variables window, save, then close and reopen the package, does it have the value you set it to? If it doesn't, make sure that you don't have a configuration set that is overwriting the variable. If the value is correct, run the package and check the value in the watch window. If it is not correct there, either an expression or a script is changing the value at runtime.|||Thanks so much. Now I remember I've tinkered about package configuration. It didn't occur to me that explains it. It's nice to see you can toggle it on/off.
I created another configuration but I can't find it in the solution explorer or in the bin table? Is the configuration available only after deployment?
|||An XML configuration will be created at whatever path you specify when you create the configuration. If you open the package configurations dialog, you should see the path to the file.
No comments:
Post a Comment