Answered by:
loop over all variables to change an variable property

Question
-
I'm currently working on an package template for my developers.
I have build an OnValueChanged - EventHandler. ( i use the great example from Eric Wishdal: http://social.msdn.microsoft.com/Forums/en/sqlintegrationservices/thread/a1987e67-37d1-4998-a978-9930d029455c)
But now i want to get shure that all variables in the package have the property: RaiseChangedEvent = True
I currently hang on an loop over all variables in the package.
Because i want to build this in an template i didn't know what variables the developers use in the future.
Does anyone have an example for such an loop?
greetings
selcer
Friday, January 25, 2013 5:24 PM
Answers
-
Note: It's not possible to loop through all variables without selecting them all as readwrite or readonly variables in The Script Task editor...
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Marked as answer by selcer Tuesday, January 29, 2013 12:24 PM
Friday, January 25, 2013 8:19 PM -
Note: It's not possible to loop through all variables without selecting them all as readwrite or readonly variables in The Script Task editor...
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
it didn't solve my problem. But i found that there is no need to add variables to the ScriptTask Dialog for usage in the Script Task.
A blog over this feature is here: http://josef-richberg.squarespace.com/journal/2009/8/12/using-variables-in-ssis-script-component.html
So now you still have to lock them for write or read by naming them all...
http://microsoft-ssis.blogspot.com/2010/12/how-to-use-variables-in-script-task.htmlPlease mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Marked as answer by selcer Monday, February 11, 2013 1:57 PM
Thursday, January 31, 2013 2:25 PM
All replies
-
Looping where?
And why each variable necessarily has to have the OnValueChanged event fired?
Arthur My Blog
Friday, January 25, 2013 5:49 PM -
As i say i want to create a template for package logging.
If a package crash i want to know the last values of the variables, such as the value of the variable that hold the last value for an dynamic set import file. Because i build an template i search for an robust solution completly implemented in eventhandlers.
We don't have a big set of rules here for package building. We have only one: Use this template for logging.
Friday, January 25, 2013 6:19 PM -
As i say i want to create a template for package logging.
If a package crash i want to know the last values of the variables, such as the value of the variable that hold the last value for an dynamic set import file.
I think you can make custom log table. The value of that variable can be loaded into log table.
Thanks,
hsbal
- Proposed as answer by ArthurZ Friday, January 25, 2013 6:59 PM
Friday, January 25, 2013 6:32 PM -
You wuold be able to capture the variable values on failure of a package using a checkpoint. The easiest way to iterate through all variables in a package would be within a script task using the Dts.VariablesDispenser. There is documentation on this on MSDN here:
Look at the code snippet using foreach to iterate through and replace the code to set the variable value.
Also take a look at Checkpoints here. You could create a template that configures using an SSIS Checkpoint that would record variable values on failure.
http://msdn.microsoft.com/en-us/library/ms140226.aspx
David Dye My Blog
- Proposed as answer by ArthurZ Friday, January 25, 2013 6:59 PM
Friday, January 25, 2013 6:36 PM -
Note: It's not possible to loop through all variables without selecting them all as readwrite or readonly variables in The Script Task editor...
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Marked as answer by selcer Tuesday, January 29, 2013 12:24 PM
Friday, January 25, 2013 8:19 PM -
Note: It's not possible to loop through all variables without selecting them all as readwrite or readonly variables in The Script Task editor...
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
it didn't solve my problem. But i found that there is no need to add variables to the ScriptTask Dialog for usage in the Script Task.
A blog over this feature is here: http://josef-richberg.squarespace.com/journal/2009/8/12/using-variables-in-ssis-script-component.html
Thursday, January 31, 2013 2:06 PM -
Note: It's not possible to loop through all variables without selecting them all as readwrite or readonly variables in The Script Task editor...
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
it didn't solve my problem. But i found that there is no need to add variables to the ScriptTask Dialog for usage in the Script Task.
A blog over this feature is here: http://josef-richberg.squarespace.com/journal/2009/8/12/using-variables-in-ssis-script-component.html
So now you still have to lock them for write or read by naming them all...
http://microsoft-ssis.blogspot.com/2010/12/how-to-use-variables-in-script-task.htmlPlease mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Marked as answer by selcer Monday, February 11, 2013 1:57 PM
Thursday, January 31, 2013 2:25 PM