0

There is a way to parametrize the connection string for SSIS. I can deploy the package to the SSIS catalog and then choose the right values when executing it.

Is there a way to set developer-specific connection string parameter value that would not change the source code of the package while the developer is working with it in Visual Studio or at least would reside in some ignored by version control file that would allow each developer to set his own connection string and would not affect any others one after committing a new version of the package?

Dmitrij Kultasev
  • 5,447
  • 5
  • 44
  • 88
  • Please check the answer to similar question on connection parametrization https://stackoverflow.com/a/58555006/1010622 – Ferdipux Jan 15 '21 at 12:41
  • in such way you can choose the env configuration when you run the package from the SSIS catalogue. I'm looking for solution that would allow to do that locally from the Visual Studio – Dmitrij Kultasev Jan 15 '21 at 12:45
  • 1
    You can change connection strings using a C# Script task. That can take variables from your SSIS package to determine what environment to point to. So do some logic or something, set a variable, then pass it to Script task and update your connection string. – Brad Jan 15 '21 at 15:52
  • @DmitrijKultasev, You have better off switching to Project Connection Managers. Thus Developer can set connection string of choice and perform tests; later he/she simply does not commit changes to Project CM from template. Environments allow server wide configuration of Connection Strings etc done by a Support Team independent of Developers. – Ferdipux Jan 15 '21 at 15:55
  • @Ferdipux that's a pain. Just don't commit will not work, people do forget to do that... Additionally you can accidentally run the package on wrong database that can disturb others as well. What I did is that I created different configuration profiles for each developer and that seems to work for us for now – Dmitrij Kultasev Jan 15 '21 at 16:00
  • If you need it by developer, you can store the possible connections per developer somewhere (perhaps centralized DB they all have access to) then change the connection using the C# code based off the users ID and look it up in the table. – Brad Jan 15 '21 at 19:27
  • @DmitrijKultasev, you can add Connection Managers to SC ignore list, for example. Or, they can create own set of Conn Managers and copy it each time when start testing. Special C# Script Task does not fit, since it is needed only for development process, and package is developed for production use. – Ferdipux Jan 16 '21 at 13:50

0 Answers0