I have a SSIS package that generates and executes other SSIS packages at runtime. I can create a package in a Script Task and add connection managers:
Package pckg = new Package();
// Create source ODBC connection
ConnectionManager source = pckg.Connections.Add("OLEDB");
source.Name = "source";
source.ConnectionString = sourceConnectionString;
if (sourcePassword != null)
{
source.Properties["Password"].SetValue(source, sourcePassword);
}
The question is: can I set the package connection manager to reference a project connection manager instead of setting the connection directly? Can the generated package access the project environment in which the generating package operates?
Many thanks