Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS changing variable scope

Tags:

ssis

How do I create a variable with a scope? It's just giving me a default which I do not want, and I'm unsure how to change. This should be simple, and a Google search leads me to believe this is quite a common problem but with no easy solutions.

imgur: http://imgur.com/uxlRf

like image 381
Waller Avatar asked Jan 15 '13 11:01

Waller


4 Answers

click on new variable button, add variable name and then click on Move Variable Button right next to add variable. and from there select Executable , to which you want to set a scope to. Hope this helps.

like image 93
Anuja Avatar answered Oct 14 '22 06:10

Anuja


Note: Scope of the variable is set based on the container you have focus before clicking the new variable button. Though BIDS Helper can help you change the scope of the variable very easily that’s the 6th button provided by BIDS Helper on top of the variable pane.

Found the above answer, not very helpful way of doing things.

like image 30
Waller Avatar answered Oct 14 '22 06:10

Waller


As someone noted, this changes with 2012. I just got bit by that and note that the 2012 documentation did NOT get updated. It still says variables are scoped to what you have selected which is NOT true. But when you're on the variables window, note the 2nd from the left icon at the top - this is the "Move Variable" button that works quite nicely to allow you to move the scope of the selected variable. BiXpress also has similar function but it's buggy in that it won't pick up OnPostExecute scope making their version very limited.

like image 32
Gary Melhaff Avatar answered Oct 14 '22 07:10

Gary Melhaff


We can change the scope of the variable in 2008 BIDS.PFB the steps I did for changing the scope of the variable from the package level to the task/container level.

1)Right click on the package.dtsx file from the Solution explorer and click on the "View code"

2)Search for the variable for which you wanted to change the scope. Copy the XML code related to that variable.

3)Search for the control for which you wanted to use this variable and copy the xml code after completion of any tag(Many tags are related to a task/container).

4)Remove the origial copied code.

5)Save this file

6)Open the package and the scope of the variable would have been changed

I am not sure If it impacts the package or not, but it worked for me.

Kindly let me know If it will impact the package or not if any one knows

like image 29
Sudheer Avatar answered Oct 14 '22 07:10

Sudheer