One important follow up note -- in my post , I use a script task to do the bulk of the work. If you follow this example and extend it to use variables (or any script task using variables), there is an important and often overlooked step to enable the script task to use your package variables. On the Script Task editor, on the Script Tab, there are two properties that you can set:
- ReadOnlyVariables
- ReadWriteVariables
It is easy to overlook these two properties, both take a comma separated list of the variables that are in scope for the script task (another point, make sure your variables have proper scope, which trips a lot of developers up when trying to have certain control flow items access a variable). Here is a screen shot of what a set variable on your script task looks like:
With ListViewGUID in the ReadOnlyVariables property, I can now access this item inside my Script Task:
spView = Dts.Variables("ListViewGUID").Value.ToString()
Tags:
Categories: SQL Server |
SSIS