Showing posts with label child. Show all posts
Showing posts with label child. Show all posts

Thursday, March 29, 2012

Configure a Child Package to use the configuration file of a Parent Package?

Hi guys,

Here's the deal. I have a child package, (say, pack01.dtsx), which uses a dtsconfig file for its connection string, which can be called from other packages, but which also can be called by itself.

However I also have another package (say, pack02.dtsx) which uses the same dtsconfig file for its connection string. It calls on pack01.dtsx.

When I use DTEXECUI and run pack01.dtsx, specifying the proper .dtsconfig file, it goes well. But when I try and run pack02.dtsx, an error occurs saying pack01.dtsx connection cannot be established.

How do I pass the connectionstring being used by pack02 to pack01, without having to remove the configuration file setting of pack01? Can a Parent Package configuration and a configuration file try and map to the same property?

Hope someone could help. Thanks.Still no idea on this guys?

Essentially I just want the child package to use and consume the same .dtsConfig file as the parent package. How do I do that?|||You can use "Parent package variable" configuration type in the child, or just set the same configuration file as the option for a configuration in the child. You cannot pass a entire configuration definition between parent and child.|||

DarrenSQLIS wrote:

You can use "Parent package variable" configuration type in the child, or just set the same configuration file as the option for a configuration in the child. You cannot pass a entire configuration definition between parent and child.

This is exactly what I did, really. And besides, when you try to pass a connectionstring through a parent package variable to a child, for some reason or another the password property value gets lost.

Any other ideas?|||

Ok so connection strings are really built from properties, and the password property will be write only, so that kind of makes sense. If you could read a connection string for a configuration to get the password, it would be a security risk, regardless of if this is for a configiuration or not.

Use a variable instead, set the variable from the configuration in the parent. Use a property expression to assign the variable value to the connection. Cannot see anything wrong with that as a solution, apart from the obvious security concerns.

|||

DarrenSQLIS wrote:

Ok so connection strings are really built from properties, and the password property will be write only, so that kind of makes sense. If you could read a connection string for a configuration to get the password, it would be a security risk, regardless of if this is for a configiuration or not.

Use a variable instead, set the variable from the configuration in the parent. Use a property expression to assign the variable value to the connection. Cannot see anything wrong with that as a solution, apart from the obvious security concerns.

I guess I'm compelled to use Windows Authentication for this case, just so I don't need to mess with the password.

Anyway, thanks Smile|||If there is a chance that you can use Windows Auth, then I would strongly recomend it, for this any many other reasons, it just makes life easier. Good luck.

Configurations and Child Packages

Hello,

I was hoping someone might be able to clarify how configuartions work with child packages. My process has 3 levels of packages. The main packages called two child packages each of which calls more child packages.

I'm using Configurations to pass variables from parent packages to child packages. But each level of packages contains Data Flow Source/Destination connections. I was planning on having only 1 XML Configuration file in the main package that would allow the data connections for the main package to be configured for the target enviornment. When the job is scheduled I will be able to point a configuration file for use with the main packages. But will that configuration file be applied to all child packages that will run? All of the Connections Managers have the same name so I'd like to make the change in one file.

If not, am I forced to define a parent/child variable to pass the Connection String from the parent to each of the child packages? Use an expression to set the Connection String dynamically? This seems like a lot of extra work, so I'd really like to see if there is a way to do it with an XML configuration file. Even if I have to definte the same config file for each of my 20+ packages.

Thanks

-Dan

Dan,

It is eminently possible for multiple packages to use a single configuration file - I use this technique all the time. What difficulties are you having in doing this?

Tip: Indirect configuratoins can really help because once you have set them up, "picking" them for use in other packages is dead dead simple.

-Jamie

|||

I guess my confusion is just in how it will work. Perhaps I can boil it down to 2 simple questions.

1. Do I specific in every one of my packages, an XML Configuration file and point them all to the configuration file I created containing all of the common Connection Managers? Or will a child package automatically inherit the configuration of its parent package?

2. When it comes to deployment, I will schedule a job in SQL Server and I will select the XML configuartion files to use for the main package. Will the child packages know to use the same configuration file as well?

I haven't been able to run this package yet as I'm doing my final cleanup for configuration and deployment. I'm trying to get a handle on how this is going to work with the child packages to know how to finish this process. I've used configurations before but only in single package solutions.

|||

infrandom wrote:

I guess my confusion is just in how it will work. Perhaps I can boil it down to 2 simple questions.

1. Do I specific in every one of my packages, an XML Configuration file and point them all to the configuration file I created containing all of the common Connection Managers? Or will a child package automatically inherit the configuration of its parent package?

Yes to the first part of that question. No to the second part.

Which is a shame actually. I know that the subject of scoping connection managers to containers was discussed but not implemented in SSIS2005 due to time constraints. It would certainly be nice to be able to do this in order that connection managers behave just like variables and connection managers in a package can be "seen" by descendant packages. If you want to raise a ticket at Microsoft Connect requesting this functionality for a future version then I will definately vote for it.

infrandom wrote:

2. When it comes to deployment, I will schedule a job in SQL Server and I will select the XML configuartion files to use for the main package. Will the child packages know to use the same configuration file as well?

I think that is kinda answered by my answers to the previous question.

infrandom wrote:

I haven't been able to run this package yet as I'm doing my final cleanup for configuration and deployment. I'm trying to get a handle on how this is going to work with the child packages to know how to finish this process. I've used configurations before but only in single package solutions.

Sounds like you're not far away

|||

Thanks for the clarification Jamie. I was was pretty sure that I would have to add it into each of the packages. Here I go, another round through them all.

Sunday, February 12, 2012

Concatinating child field

I'm developing an ASP.NET app with SQL back end. I'm trying to develop a use
r
interface that must reference information from two related tables and would
like to return the following (either in table, but preferably in datagrid):
ParentField1 ParentField2 Parent Field3 ChildField1Record1
ChildField1Record2
ChildField1Record3
ParentField1 ParentField2 ParentField3 ChildFeld1Record4
ChildFeld1Record5
ChildField1Record6 etc.
Is there anyway to write a TSQL function to concatinate the child records
into a dynamic field (there are about 400 parent records)
I could create a denormalized table that mimics the child table by has the
ParentID and ChildRecords concatinated that gets updated everytime the child
table changes, but that's just bad programming!
Any suggestions would be greatly appreciated.
Thanks in advance.well the question is not clear to me. but i guess u are trying to concatinat
e
the fields in the query
ucan do it as
select <field1> + <field2> + ..
FROM <Table>
please let me know if u have any questions
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"AbeR" wrote:

> I'm developing an ASP.NET app with SQL back end. I'm trying to develop a u
ser
> interface that must reference information from two related tables and woul
d
> like to return the following (either in table, but preferably in datagrid)
:
> ParentField1 ParentField2 Parent Field3 ChildField1Record1
> ChildField1Record2
> ChildField1Record3
> ParentField1 ParentField2 ParentField3 ChildFeld1Record4
> ChildFeld1Record5
> ChildField1Record6 etc.
> Is there anyway to write a TSQL function to concatinate the child records
> into a dynamic field (there are about 400 parent records)
> I could create a denormalized table that mimics the child table by has the
> ParentID and ChildRecords concatinated that gets updated everytime the chi
ld
> table changes, but that's just bad programming!
> Any suggestions would be greatly appreciated.
> Thanks in advance.|||Hi Chandra,
Thanks for the response, and sorry for not being clear. Actually I am trying
to return contents of all records with the ParentID from the child table wit
h
the parent record from the parent table, so actually want to select
record1field1 + record2field1 + record3field1 from chldtable joining
parenttable without repeating the parent data for each record.
Regards,
AbeR
"Chandra" wrote:
> well the question is not clear to me. but i guess u are trying to concatin
ate
> the fields in the query
> ucan do it as
> select <field1> + <field2> + ..
> FROM <Table>
> please let me know if u have any questions
>
> --
> best Regards,
> Chandra
> http://chanduas.blogspot.com/
> http://www.SQLResource.com/
> ---
>
> "AbeR" wrote:
>|||>> Is there anyway to write a TSQL function to concatinate the child records
The terminology you used is a bit confusing.
Assuming that there is a one-to-many relationship that exist between the
tables, what you seem to be asking is to return a resultset with the single
value from the referenced table and all the values from the referencing
table as a contenated string. In general, such processing which demand heavy
looping and formatting of values should be done on the client side -- quite
often one should be able to leverage the functionality of a programming
language or a report-writer in such cases.
Doing this on the server often requires procedural logic, often disguised as
a user defined function or perhaps cursors. For some such workarounds, refer
to: http://tinyurl.com/aka4u
Anith|||Exactly. I was hoping not to create another dataset on the client system, bu
t
that's probably the best approach (While loops in C# within the app)...
DataSet1 will be read by the client and produce dataset two with all the
values from the referenced table as one string and then present in a datagri
d.
Many thanks for the advice and reference.
- AbeR
"Anith Sen" wrote:

> The terminology you used is a bit confusing.
> Assuming that there is a one-to-many relationship that exist between the
> tables, what you seem to be asking is to return a resultset with the singl
e
> value from the referenced table and all the values from the referencing
> table as a contenated string. In general, such processing which demand hea
vy
> looping and formatting of values should be done on the client side -- quit
e
> often one should be able to leverage the functionality of a programming
> language or a report-writer in such cases.
> Doing this on the server often requires procedural logic, often disguised
as
> a user defined function or perhaps cursors. For some such workarounds, ref
er
> to: http://tinyurl.com/aka4u
> --
> Anith
>
>