Variable Scope
Hi, I opened package_1.dtsx. When I clicked on variables, they all have Scope of package_2.dtsx. I try to add a new variable, but it again created a Scope of package_2.dtsx. Can someone help me here....? How to get correct Scope...? What causes this problem...? Configuration....? Thanks, Dmitry
May 27th, 2011 3:07pm

Can you just right click anywhere on the canvas and choose Variables, in that variables editor modify the scope to whatever wording you need e.g. PackageArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 3:09pm

I can change Variable name, but not the Scope.
May 27th, 2011 3:19pm

Can you re-create the variable?Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 3:21pm

Unfortunately you can't change scope once the variables are created. Whatever is in focus when you create the variable will be the scope of that variable. If you want the scope to be the package then you need to click on an empty area in the control flow of the package. Or open the variables window as ArthurZ described.JAM
May 27th, 2011 3:26pm

Yes, but it get assigned the wrong Scope for a different package. Could something in my SSIS Package Configuration have caused it, though I disabled it for now. My other project has no problems and all Variables got correct Scope.
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 3:27pm

Yes, but it get assigned the wrong Scope for a different package. Could something in my SSIS Package Configuration have caused it, though I disabled it for now. My other project has no problems and all Variables got correct Scope. The scope is set automatically when you create a variable and can't be changed. The scope depends on what task you have selected while creating the variable. The easiest way to create a variable on the package scope/level is to make sure nothing is selected when you add a variable (click somewhere on the canvas like Arthur suggested). Here is a feedback suggestion to Microsoft about changing the scope: https://connect.microsoft.com/SQLServer/feedback/details/124853/variables-changing-scope-once-created-is-not-possible (but as often it's already closed as won't fix) Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
May 27th, 2011 3:38pm

Hi, I opened package_1.dtsx. When I clicked on variables, they all have Scope of package_2.dtsx. I try to add a new variable, but it again created a Scope of package_2.dtsx. Can someone help me here....? How to get correct Scope...? What causes this problem...? Configuration....? Thanks, Dmitry When you renamed the package file name.... did you rename the package object as well? I think you forgot that. Just rename the file once again and confirm the question about renaming the renaming the package object. Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 3:46pm

I opened Control Flow of package_1. Right Clicked on the canvas and selected Variables. All Variables have incorrect Scope and a new Variable I try to add also generated wrong Scope.
May 27th, 2011 3:49pm

I opened Control Flow of package_1. Right Clicked on the canvas and selected Variables. All Variables have incorrect Scope and a new Variable I try to add also generated wrong Scope. Did you try renaming the package (object)?Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 3:52pm

It all happened after I created package_2 and created SSIS Package Configurations for it. All variables in all packages got a new Scope - Package_2.
May 27th, 2011 3:53pm

Have you followed what SSISJoost suggested?Jeff Wharton MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt) MCT, MCPD, MCITP, MCDBA Blog: MrWharty.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2011 3:29am

It all happened after I created package_2 and created SSIS Package Configurations for it. All variables in all packages got a new Scope - Package_2. are you using shared configuration files to set the variables?Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
May 28th, 2011 6:43am

Yes, I tried renaming and even deleted the package that caused all Scopes to go bad. But it is still all set to a single wrong name. Yes, all packages in this project share the configuration files, is this a problem....? But I just tried to create a new variable, not known to the configuration manager, and it received a wrong Scope. What is the most amazing is that all packages work correctly, even when I add a new variable with an incorrect Scope. It teats it like a correct Scope. Though I am new to SSIS, this does look like a bug to me. I hope it will work correctly in production also. And huge thanks for your help. Dmitry.
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2011 5:17pm

Can you try this: download BIDS Helper and try changing the variable scope using it as described here: http://bidshelper.codeplex.com/wikipage?title=Variables%20Window%20Extensions&version=2&ProjectName=bidshelper Arthur My Blog
May 29th, 2011 11:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics