Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

How to change the connection string of child packages in Execute Package task? Expand / Collapse
Author
Message
Posted Friday, July 12, 2013 5:31 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:53 AM
Points: 5,228, Visits: 9,443
prakashr.r7 (7/12/2013)
Sorry John, I am not getting you...Could you please make me clear?

Check this out. You can then use the variable to set the ConnectionString property of your connection manger in the child package.

John
Post #1472950
Posted Friday, July 12, 2013 9:23 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, March 27, 2014 2:39 PM
Points: 2,141, Visits: 486
https://www.artisconsulting.com/blogs/greggalloway/Lists/Posts/Post.aspx?ID=15
Post #1473105
Posted Monday, July 15, 2013 10:09 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, May 20, 2014 6:58 AM
Points: 138, Visits: 195
Koen Verbeeck (7/12/2013)
You can create only one config file that stores for example the servername and the database. And you can pass this config file along when calling the child packages with DTEXEC.

In this case you'll have to make a config file for each environment.


Do we have to create config file while creating the master package? I am just curious ....if we have 5 child packages ...all those combined together forming a master package...when we do config file at the master package environment, will the file pass the value to the child pacakges? how does one package's variable affect the other?

I am getting confused on this...Please bear with me, Koen...
Post #1473753
Posted Monday, July 15, 2013 10:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, May 20, 2014 6:58 AM
Points: 138, Visits: 195
John Mitchell-245523 (7/12/2013)
prakashr.r7 (7/12/2013)
Sorry John, I am not getting you...Could you please make me clear?

Check this out. You can then use the variable to set the ConnectionString property of your connection manger in the child package.

John


Okay John..How do we change the connection string for the child packages.... we create config files for each package....when i use Execute Package task to create a master package , i don't see any way (i may not know) to change the connection string even running through BIDS....so if we create config file, how does this file will affect all the child package connection string? Why i am asking this because, child packages are created by different project...i create new project for master package...so how does these two packages connect with each other through config files?
Post #1473757
Posted Tuesday, July 16, 2013 1:02 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:53 AM
Points: 5,228, Visits: 9,443
The config file does not (directly) affect the connection string in the child package. The child package inherits the value of a variable from the master package. You then use that variable to build an expression to set the value of the connection string in your child package. Have a read of this for more information. Once you've created your packages like that, the only way you can set the value of that variable is to call the child package from the parent, therefore if you're running it in BIDS you need to run the parent package and wait for it to call the child.

John
Post #1474004
Posted Wednesday, July 31, 2013 9:37 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 308, Visits: 812
.when we do config file at the master package environment, will the file pass the value to the child pacakges


You wont need to create a config file for the master package, only the child packages. The master package should have variables, these will hold the values that you want to pass to the child packages. In the child packages, create variables there as well to catch the values that the parent package variables will pass to the child packages. Right click in the control flow area and select 'package configuration..' , then Add, then follow the wizard. The configuration type will be 'parent package variable.' This is where you map the values between the variables of the child and parent packages (make certain data types match). With this complete in your child package you are free to use your local variables in expressions (for ole db connection 'servername' property for example) as you normally do.
Post #1479545
Posted Thursday, August 1, 2013 1:07 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:53 AM
Points: 5,228, Visits: 9,443
mmartin1 (7/31/2013)
You wont need to create a config file for the master package, only the child packages.

Whilst that's true in the strictest sense, all but the simplest of packages should use config file (or some other external method of package configuration). That way, when you want to run the package on a different server or change the number of retries, for example, you just edit the configuration file instead of having to redeploy the whole solution.

John
Post #1479808
Posted Thursday, August 1, 2013 4:21 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, May 20, 2014 6:58 AM
Points: 138, Visits: 195
Okay Martin...Let me try with config file for each child package...
Post #1479863
Posted Thursday, August 1, 2013 4:24 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, May 20, 2014 6:58 AM
Points: 138, Visits: 195

Whilst that's true in the strictest sense, all but the simplest of packages should use config file (or some other external method of package configuration). That way, when you want to run the package on a different server or change the number of retries, for example, you just edit the configuration file instead of having to redeploy the whole solution.


I believe i got the idea of what you are saying. Let me try. Sorry that I took some time to make myslef clear.
Post #1479865
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse