Your humble opinion sounds great man.That's a better way of executing the
"Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
news:uENrio3FFHA.3824@TK2MSFTNGP10.phx.gbl...
> Ok So you want to retrieve the values of child package Global Variables
> and use them in you Parent as well as setting child global variables from
> a parent package.
>
> IMHO do not bother with the ExecutePackage task.
>
> Call your package through the object model in the parent.
>
> Pass and retrieve Global variables this way.
>
> Execute a package from a package
> (
http://www.sqldts.com/default.aspx?215)
>
>
>
> --
>
> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>
www.SQLDTS.com - The site for all your DTS needs.
>
www.SQLIS.com - SQL Server 2005 Integration Services.
>
www.Konesans.com >
>
> "ALI-R" <Ray@Alirezaei.com> wrote in message
> news:ejmVgh3FFHA.548@TK2MSFTNGP14.phx.gbl...
>> This is exactly what I am doing .I'm having two packages as follows:
>>
>> 1) Child Package (This package is called by Execute Package Task in the
>> parent package)
>> A) A global Variable called **Child_Var**
>> B) An Execute Sql Task which uses **Child_Var** to do something
>> dynamically (for instance inserting to a table)
>>
>> 2) Parent Package:
>> A) A gloabl variable called *Parent_Var*
>> B) An ActiveX script which sets *Parent_Var* to the inner Package
>> global variable of the Execute Package Task(which is **Child_Var** of the
>> child package)
>> C) A Execute Package Task (In which I'm using **Child_Var** as its
>> inner Package global variable )
>>
>>
>> I think for the above scenario ,I can't use Outter Global Variable.Right?
>>
>> Is the above scenario makes sence?
>>
>> Thanks very much for monitoring this thread.
>>
>> Ali-R
>> "Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
>> news:eLwSCPyFFHA.3928@TK2MSFTNGP15.phx.gbl...
>>> Then you have a couple of options
>>>
>>> 1. If you are using the ExecutePackage task then you can pass through a
>>> Parent package Global Variable to the child. The child will then "See"
>>> this Global variable and its value and use it. You can pass a value to
>>> the Parent Package Global Variable using DTSRUN and the /A switch
>>>
>>> 2. Use Active X Script. No real difference here you simply do not have
>>> a Gui. The advantage of this method is you can receive Global variables
>>> values from the child package back in the parent. You set the value of
>>> the child Global Variables through code assigning values to them from
>>> Parent package Global Variables and you set those by DTSRUN and the /A
>>> switch.
>>>
>>> Make sene?
>>>
>>> --
>>>
>>> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>>>
www.SQLDTS.com - The site for all your DTS needs.
>>>
www.SQLIS.com - SQL Server 2005 Integration Services.
>>>
www.Konesans.com >>>
>>>
>>> "ALI-R" <Ray@Alirezaei.com> wrote in message
>>> news:u55YwJtFFHA.2180@TK2MSFTNGP12.phx.gbl...
>>>>> Outer global variables are used to pass a variable (and its value)
>>>>> from
>>>>> the parent to the child.
>>>>
>>>> I have absolutely no idea how to use Outer global variables to pass
>>>> variable and its value to a child package ,currently I'm using this
>>>> script in the parent to assign the package's global variable to the
>>>> excute package task's inner global variable :
>>>>
>>>> Function Main()
>>>>
>>>> Set oPKG = DTSGlobalVariables.Parent
>>>> For Each oTask in oPKG.Tasks
>>>> 'Test for Execute Package Task
>>>> If oTask.CustomTaskID = "DTSExecutePackageTask" Then
>>>> 'Get CustomTask (DTS ExecutePackage Task) Object
>>>> Set oCustomTask = oTask.CustomTask
>>>> 'Set new Inner Package Global Variable value
>>>>
>>>> oCustomTask.GlobalVariables("TextFilePath_Child").Value=DTSGlobalVariables("TextFilePath_Parent").Value
>>>> End If
>>>> Next
>>>> Main = DTSTaskExecResult_Success
>>>> End Function
>>>>
>>>> My problem was that I wanted not to use the script and use something
>>>> else (like dynamic propert task)
>>>> Here is what I want to do :
>>>>
>>>> 1) I'd like to pass a string (through "DTSRUN" command line ) to my
>>>> parent package
>>>>
>>>> 2)Then I'de like the parent package sends that string to the child
>>>> package.
>>>>
>>>>
>>>> Thanks
>>>> "Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
>>>> news:%23l1q$5sFFHA.2608@TK2MSFTNGP10.phx.gbl...
>>>>> Outer global variables are used to pass a variable (and its value)
>>>>> from
>>>>> the parent to the child.
>>>>>
>>>>> Inner global variables are used to assign a value to an existing
>>>>> variable in the child, but the value is coded in the Exec Pkg Task,
>>>>> and
>>>>> is not available in the parent.
>>>>>
>>>>>
>>>>> It is most common to pass a variable and value from the parent to the
>>>>> child. Inner variables are less frequently used, but still can be
>>>>> useful.
>>>>>
>>>>>
>>>>>
>>>>> In the Execute Package task in the Dynamic Properties task.
>>>>>
>>>>> The only Global variables property you can set is the
>>>>> InnerGlobalVariables collection which in the task is the Outer Package
>>>>> Global Variables tab which is in turn the global variables in your
>>>>> calling package
>>>>>
>>>>> You can set what Global variable gets passed (You can set the value in
>>>>> the Global Variables properties sheet).
>>>>>
>>>>> You do not have the ability as far as i can see through the dynamic
>>>>> properties task to set which Global Variable in the called package is
>>>>> being set.
>>>>>
>>>>>
>>>>> Does this help?
>>>>>
>>>>> --
>>>>>
>>>>> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>>>>>
www.SQLDTS.com - The site for all your DTS needs.
>>>>>
www.SQLIS.com - SQL Server 2005 Integration Services.
>>>>>
www.Konesans.com >>>>>
>>>>>
>>>>> "ALI-R" <Ray@Alirezaei.com> wrote in message
>>>>> news:uj6J1fsFFHA.3648@TK2MSFTNGP10.phx.gbl...
>>>>>> Thanks for your reply.
>>>>>>
>>>>>> If there is no such a functionality ,why when you place a Dynamic
>>>>>> properties task in your package and open it,in the section for
>>>>>> ExecutePackage task ,you can set its Inner Package golbal variable to
>>>>>> whatever you want? I set it to the package's global variable and I
>>>>>> pass the package's global variable from command line(using dtsrun)
>>>>>> ,but the problem is that this assignment dosen't work:-)
>>>>>>
>>>>>> Ali-r
>>>>>>
>>>>>>
>>>>>> "Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
>>>>>> news:%23c4VlgqFFHA.936@TK2MSFTNGP12.phx.gbl...
>>>>>>> If your question is
>>>>>>>
>>>>>>> "Can the Dynamic properties task reach inside my ExecutePackage task
>>>>>>> an grab something from there?"
>>>>>>>