0

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

  • Why? If you are generating a package, why not just generate it with the value of the Project connection instead of trying to have the generated package try to access the project connection directly? – Tab Alleman Jun 05 '18 at 17:20
  • The password - I cannot read the password from a ConnectionManager object; it's a write-only property, so I cannot replicate a project connection manager with a password. Though I could try storing the password in a sensitive property and reading from there...if there is no simplier way. – Radovan Jankovic Jun 05 '18 at 17:27

0 Answers0