ApplicationName in project connection manager

Peter Bishop 161 Reputation points
2024-07-18T13:24:58.9766667+00:00

We have a large number of packages within an SSIS project and these make use of project connection managers. I would like to change the ApplicationName property of the connection string to reflect which package it is coming from as this will be useful when running sp_who2 on the SQL Server to see which package is associated with a connection.

Is there a way to do this? I can only find project variables being accessible when configuring the project connection manager - seems reasonable - but is there a way around this when the connection is being established?

Thanks.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,520 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,731 Reputation points
    2024-07-18T15:24:33.2133333+00:00

    Hi @Peter Bishop,

    You can try to use an Expression for a connection to adjust ApplicationName property value on the fly.

    A couple of SSIS system variables are good candidates to be used:

    • PackageID, The unique identifier of the package.
    • PackageName, The name of the package.

    https://learn.microsoft.com/en-us/sql/integration-services/system-variables?view=sql-server-ver16

    0 comments No comments

  2. Michael Taylor 51,016 Reputation points
    2024-07-18T15:40:53.2733333+00:00

    Normally you define the CM at the project level. Then within a package you add a "reference" to the CM. Within this reference you can parameterize the connection string. So this is doable at the package level.

    But what I might start with is setting your project CM's connection string to have application name portion of the string use the PackageName system variable. I'm not sure it'll pass validation at the project level. If that doesn't work then you'll need to instead make that change inside the package's CM properties.