![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can someone assist in a code snippet showing how I can manipulate a Parent DTS package from a child DTS package. Example: DTSPack1 calls DTSPack2. I want DTSPack2 to be able to change some of the connection properties in DTSPack1 - so that when it returns to DTSPack1 it will continue running with these new settings. -- |
#3
| |||
| |||
|
|
In message <e51QH$S2DHA.2456 (AT) TK2MSFTNGP12 (DOT) phx.gbl>, Joe horj235 (AT) lni (DOT) wa.gov> writes Can someone assist in a code snippet showing how I can manipulate a Parent DTS package from a child DTS package. Example: DTSPack1 calls DTSPack2. I want DTSPack2 to be able to change some of the connection properties in DTSPack1 - so that when it returns to DTSPack1 it will continue running with these new settings. -- This article demonstrates how to load and execute a child package. Execute a package from a package (http://www.sqldts.com/default.aspx?215) Any changes made to the child by the parent will only persist fro the lifetime of the package object variable, declared as oPkg in the sample. To persist this changes further you will need to call the SaveToSQLServer method. Not sure why you would need to do this though. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
This is a more precise question - as I wasn't very clear on my problem: Can anyone offer a code snippet that will allow me from a Child DTS Package, modify settings on the Parent DTS package. Example: DTSPack1 calls DTSPack2. Within DTSPack2 some of the connection settings inside DTSPack1 are changed. When DTSPack2 returns to DTSPack1 the adjusted settings would be executed. Below is a code snipped that changes a connection setting within the parent package - but I want to execute this from a child package. So the first line that refers to Set oPkg = DTSGlobalVariables.Parent I would think needs to be changed to refer to the parent DTS package - but I can't figure it out: ' Get reference to current package Set oPkg = DTSGlobalVariables.Parent ' Get Tasks collection Set oTask = oPkg.Tasks 'Set up Connection Set oConn = oPkg.Connections("PAC") oConn.DataSource = oRS.Fields("SrcDSNName") oConn.Password = oRS.Fields("SrcDSNPass") oConn.UserID = oRS.Fields("SrcDSNUser") |
![]() |
| Thread Tools | |
| Display Modes | |
| |