dbTalk Databases Forums  

Execute Package Task and setting its inner Package Global Vaiables

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Execute Package Task and setting its inner Package Global Vaiables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ALI-R
 
Posts: n/a

Default Execute Package Task and setting its inner Package Global Vaiables - 02-18-2005 , 05:14 PM






I have an Execute Package which calls another package and passes its inner
package global variable into the child package's global variable ,I have a
global variavle in the master package which I like to set to execute package
task's inner package global variable.I have done this by writing an script
in the master package ,I was just wondering if I can do it thought Dynamic
Properties task.I placed a dynamic property task in the master package and
in the task section I assigned the innerGlobalVariable to the globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-19-2005 , 11:27 AM






If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I know)

--

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" <newbie (AT) microsoft (DOT) com> wrote

Quote:
I have an Execute Package which calls another package and passes its inner
package global variable into the child package's global variable ,I have a
global variavle in the master package which I like to set to execute package
task's inner package global variable.I have done this by writing an script
in the master package ,I was just wondering if I can do it thought Dynamic
Properties task.I placed a dynamic property task in the master package and
in the task section I assigned the innerGlobalVariable to the globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks





Reply With Quote
  #3  
Old   
ALI-R
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-19-2005 , 03:14 PM



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 (AT) no-spam (DOT) sqldts.com> wrote

Quote:
If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task an
grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I know)

--

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" <newbie (AT) microsoft (DOT) com> wrote in message
news:%23gSMU%23gFFHA.3928 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I have an Execute Package which calls another package and passes its inner
package global variable into the child package's global variable ,I have
a
global variavle in the master package which I like to set to execute
package
task's inner package global variable.I have done this by writing an
script
in the master package ,I was just wondering if I can do it thought
Dynamic
Properties task.I placed a dynamic property task in the master package
and
in the task section I assigned the innerGlobalVariable to the
globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks







Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-19-2005 , 04:02 PM



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 (AT) Alirezaei (DOT) com> wrote

Quote:
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 (AT) no-spam (DOT) sqldts.com> wrote

If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I know)

--

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" <newbie (AT) microsoft (DOT) com> wrote

I have an Execute Package which calls another package and passes its inner
package global variable into the child package's global variable ,I have a
global variavle in the master package which I like to set to execute package
task's inner package global variable.I have done this by writing an script
in the master package ,I was just wondering if I can do it thought Dynamic
Properties task.I placed a dynamic property task in the master package and
in the task section I assigned the innerGlobalVariable to the globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks









Reply With Quote
  #5  
Old   
ALI-R
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-19-2005 , 04:29 PM



Quote:
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").Va lue
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 (AT) no-spam (DOT) sqldts.com> wrote

Quote:
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 (AT) Alirezaei (DOT) com> wrote in message
news:uj6J1fsFFHA.3648 (AT) TK2MSFTNGP10 (DOT) 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 (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23c4VlgqFFHA.936 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task an
grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I know)

--

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" <newbie (AT) microsoft (DOT) com> wrote in message
news:%23gSMU%23gFFHA.3928 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I have an Execute Package which calls another package and passes its
inner
package global variable into the child package's global variable ,I
have a
global variavle in the master package which I like to set to execute
package
task's inner package global variable.I have done this by writing an
script
in the master package ,I was just wondering if I can do it thought
Dynamic
Properties task.I placed a dynamic property task in the master package
and
in the task section I assigned the innerGlobalVariable to the
globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks











Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-20-2005 , 02:12 AM



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 (AT) Alirezaei (DOT) com> wrote

Quote:
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").Va lue
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 (AT) no-spam (DOT) sqldts.com> wrote

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 (AT) Alirezaei (DOT) com> wrote

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 (AT) no-spam (DOT) sqldts.com> wrote

If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I know)

--

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" <newbie (AT) microsoft (DOT) com> wrote

I have an Execute Package which calls another package and passes its inner
package global variable into the child package's global variable ,I have a
global variavle in the master package which I like to set to execute package
task's inner package global variable.I have done this by writing an script
in the master package ,I was just wondering if I can do it thought Dynamic
Properties task.I placed a dynamic property task in the master package and
in the task section I assigned the innerGlobalVariable to the globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks













Reply With Quote
  #7  
Old   
ALI-R
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-20-2005 , 12:17 PM



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 (AT) no-spam (DOT) sqldts.com> wrote

Quote:
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 (AT) Alirezaei (DOT) com> wrote in message
news:u55YwJtFFHA.2180 (AT) TK2MSFTNGP12 (DOT) 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").Va lue
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 (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23l1q$5sFFHA.2608 (AT) TK2MSFTNGP10 (DOT) 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 (AT) Alirezaei (DOT) com> wrote in message
news:uj6J1fsFFHA.3648 (AT) TK2MSFTNGP10 (DOT) 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 (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23c4VlgqFFHA.936 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task
an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I
know)

--

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" <newbie (AT) microsoft (DOT) com> wrote in message
news:%23gSMU%23gFFHA.3928 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I have an Execute Package which calls another package and passes its
inner
package global variable into the child package's global variable ,I
have a
global variavle in the master package which I like to set to execute
package
task's inner package global variable.I have done this by writing an
script
in the master package ,I was just wondering if I can do it thought
Dynamic
Properties task.I placed a dynamic property task in the master
package and
in the task section I assigned the innerGlobalVariable to the
globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks















Reply With Quote
  #8  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-20-2005 , 12:31 PM



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 (AT) Alirezaei (DOT) com> wrote

Quote:
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 (AT) no-spam (DOT) sqldts.com> wrote

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 (AT) Alirezaei (DOT) com> wrote

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").Va lue
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 (AT) no-spam (DOT) sqldts.com> wrote

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 (AT) Alirezaei (DOT) com> wrote

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 (AT) no-spam (DOT) sqldts.com> wrote

If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I know)

--

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" <newbie (AT) microsoft (DOT) com> wrote

I have an Execute Package which calls another package and passes its inner
package global variable into the child package's global variable ,I have a
global variavle in the master package which I like to set to execute package
task's inner package global variable.I have done this by writing an script
in the master package ,I was just wondering if I can do it thought Dynamic
Properties task.I placed a dynamic property task in the master package and
in the task section I assigned the innerGlobalVariable to the globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks

















Reply With Quote
  #9  
Old   
ALI-R
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 02-20-2005 , 01:09 PM



Your humble opinion sounds great man.That's a better way of executing the
child package.

Thanks for your nice help.

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
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 (AT) Alirezaei (DOT) com> wrote in message
news:ejmVgh3FFHA.548 (AT) TK2MSFTNGP14 (DOT) 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 (AT) no-spam (DOT) sqldts.com> wrote in message
news:eLwSCPyFFHA.3928 (AT) TK2MSFTNGP15 (DOT) 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 (AT) Alirezaei (DOT) com> wrote in message
news:u55YwJtFFHA.2180 (AT) TK2MSFTNGP12 (DOT) 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").Va lue
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 (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23l1q$5sFFHA.2608 (AT) TK2MSFTNGP10 (DOT) 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 (AT) Alirezaei (DOT) com> wrote in message
news:uj6J1fsFFHA.3648 (AT) TK2MSFTNGP10 (DOT) 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 (AT) no-spam (DOT) sqldts.com> wrote in message
news:%23c4VlgqFFHA.936 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task
an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I
know)

--

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" <newbie (AT) microsoft (DOT) com> wrote in message
news:%23gSMU%23gFFHA.3928 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I have an Execute Package which calls another package and passes its
inner
package global variable into the child package's global variable ,I
have a
global variavle in the master package which I like to set to
execute package
task's inner package global variable.I have done this by writing an
script
in the master package ,I was just wondering if I can do it thought
Dynamic
Properties task.I placed a dynamic property task in the master
package and
in the task section I assigned the innerGlobalVariable to the
globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks



















Reply With Quote
  #10  
Old   
Kerry
 
Posts: n/a

Default Re: Execute Package Task and setting its inner Package Global Vaiables - 03-03-2005 , 12:50 PM



Use it how?

I have a similar issue. I have an inner package that has an ExecuteSQL task
that accepts a date parameter which I have mapped to a global variable (in
the inner package) for test purposes I have set this value to '1/1/2005'
(without quotes of course). I want to set the value of this parameter from
the outer package. In the outer package I have created a global variable
and set its value to '2/1/2005'. When I run the execute package step (outer
package), '1/1/2005' is the value that is used by the inner package, not the
outer package value.

What am I doing wrong?

Kerry Carroll


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
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 (AT) Alirezaei (DOT) com> wrote

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
Quote:
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 (AT) no-spam (DOT) sqldts.com> wrote

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 (AT) Alirezaei (DOT) com> wrote

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 (AT) no-spam (DOT) sqldts.com> wrote

If your question is

"Can the Dynamic properties task reach inside my ExecutePackage task
an grab something from there?"

then the answer is unfortuntely not. (Or at least not as far as I
know)

--

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" <newbie (AT) microsoft (DOT) com> wrote

I have an Execute Package which calls another package and passes its
inner
package global variable into the child package's global variable ,I
have a
global variavle in the master package which I like to set to execute
package
task's inner package global variable.I have done this by writing an
script
in the master package ,I was just wondering if I can do it thought
Dynamic
Properties task.I placed a dynamic property task in the master
package and
in the task section I assigned the innerGlobalVariable to the
globalVariable
of the package,but it dosen't pass the variable.

Any idea? I appreciate it.

Thanks















Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.