Expression in connection Manager in SSIS

Generally when we are creating some package, directly we will connect our source and destination database and then start to create flow.

Actually, when we are deploying the package from one system to another system, it’s very difficult to update the connection string.

Example: Hardcode Connection String in Connection Manager

Here we are directly select the source DB and database for the connection string.

How we can do expressions for connectionString? By declaring the package variable and the variable need to assign in dB connection expression setting. Following the below step, you can get to know how we can place the dynamic connection string.

Declare two variables for DataSource and InitialCatlog

Use the below Expression and concatenate the DataSource and InitialCatalog

"Data Source="+ @[User::DataSource] + " ;
Initial Catalog=" + @[User::InitialCatalog_Std]  +";Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"

Thank You.!!!

Leave a Reply

Prabhakaran Jayaraman