![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
Outer global variables are used to pass a variable (and its value) from the parent to the child. |
|
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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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 |
#9
| |||
| |||
|
|
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 |
#10
| |||
| |||
|
|
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(" |
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |