How to log Connection string in SSIS

zoe Ohara 286 Reputation points
2020-08-18T09:15:19.207+00:00

Hi,

I have a package which runs from a SQL Server and connects to dozens of other instances on the network before running various scripts. I am getting a lot of

SSIS Error Code DTS_E_CANNOTAQUIRECONNECTIONFROMCONNECTIONMANAGER

Is there any way to log the connection string the package is trying to use to a file or SQL table?

Thanks,

Zoe

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

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,201 Reputation points
    2020-08-18T12:41:23.113+00:00

    Hi Zoe,

    SSIS is using Project and Package level connections. They are always available.
    Additionally, a connection could have an expression. It makes it dynamic.

    Please provide additional details about connections in your environment.

    0 comments No comments

  2. Monalv-MSFT 5,896 Reputation points
    2020-08-19T07:03:20.277+00:00

    Hi Zoe,

    We can use Script Task to extract the connection string and save the connection string into files.

    Please do as the following codes and pictures shown:

    public void Main()  
    		{  
                ConnectionManager cm = Dts.Connections["OLEDBConnection"];  
                string ConnString = cm.ConnectionString;  
                MessageBox.Show("OLEDB Connection String: "+ConnString);  
                System.IO.File.WriteAllText("C:/Test/SSIS/TestFile/ConnStr.txt", "OLEDB Connection String: "+ConnString);  
      
                Dts.TaskResult = (int)ScriptResults.Success;  
    		}  
    

    18706-scripttaskextractconnectionstring.png
    18676-saveconnectionstringtofile.png

    We can refer to SSIS save string variable to text file.

    Best Regards,
    Mona

    ----------

    If the response is helpful, please click "Accept Answer" and upvote it.