all groups > sql server dts > july 2006 >
You're in the

sql server dts

group:

Changing sub-package global variable with ActiveX



Changing sub-package global variable with ActiveX rmcompute
7/6/2006 4:03:01 PM
sql server dts: I set up a package within another package. The inner package has a global
variable, vartest, of which its default value can be manually changed from
the outer package by clicking on the package task and then clicking Inner
Package Global Variables. I set up an ActiveX script to try to
programatically change the inner package global variable, but seem to be
having trouble:

Set oPKG = DTSGlobalVariables.Parent
oPKG.Steps("DTSStep_DTSExecutePackageTask_1").
DTSGlobalVariables("Vartest").Value = "Phone"

Object doesn’t support this property or method ……………..


Can this be done ? Also can the step name be changed,
DTSStep_DTSExecutePackageTask_1 is not very descriptive.
Re: Changing sub-package global variable with ActiveX Davide
7/6/2006 11:19:50 PM

[quoted text, click to view]

Hi rmcompute,
the 'Step' object does not have a collection of Global Variables, so
your script is wrong.
You should set the value of a Global Variable in the outer package
using the ActiveX script, then pass this GlobalVar to the inner one.

If you wanna change a step name:

1) Delete temporarly the costraints which link this step to other
steps.
2) Mouse Righ-Click-->Disconnected edit --> Steps --> (your step) -->
Name porperty
3) After having renamed the step restore the constraints you previously
deleted.

Bye
Re: Changing sub-package global variable with ActiveX rmcompute
7/8/2006 9:43:01 AM
Thanks Davide. The disconnected edit worked. I still have an issue with
passing the global variable to the inner package. I created a variable in
the outer package with:

DTSGlobalVariables("Vartest").value = "Test05"

Inside of the Package task I set the following on the
InnerPackageGlobalVariables:

Name Type Value
Vartest String <not displayable>

The global variable has definitely been set on the outer package, but it is
not being passed to the inner package. Is there something else that needs to
be done ?


[quoted text, click to view]
Re: Changing sub-package global variable with ActiveX Davide
7/9/2006 6:18:14 AM

[quoted text, click to view]

To pass the Variable to inner package:

Inside of the Package task select 'VarTest' from the
OuterPackageGlobalVariables.
Bye
Re: Changing sub-package global variable with ActiveX rmcompute
7/9/2006 4:20:01 PM
It worked. Thanks again !

[quoted text, click to view]
AddThis Social Bookmark Button