SQL agent job step's connection managers Is there any way with T-SQL to list the connection managers that are used in an SQL Agent Job step?
Given that SSIS tasks are XML files, I would have thought that it would be possible to write a T-SQL XML query to find the connection objects.

You would need to search the XML for instances of

&lt;DTS:ConnectionManager&gt;


Here's a sample from a project I have:

&lt;DTS:ConnectionManager&gt;
  &lt;DTS:Property DTS:Name="DelayValidation"&gt;0&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="ObjectName"&gt;SQLOverview&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="DTSID"&gt;{1e0a262f-476a-49d8-873b-acf7e3d7d46e}&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="Description"&gt;
&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="CreationName"&gt;OLEDB&lt;/DTS:Property&gt;
  &lt;DTS:ObjectData&gt;
    &lt;DTS:ConnectionManager&gt;
      &lt;DTS:Property DTS:Name="Retain"&gt;0&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="ConnectionString"&gt;Data Source=MyPC\SQL2008R2Dev;Initial Catalog=SQLOverview;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SQLOverview;&lt;/DTS:Property&gt;
    &lt;/DTS:ConnectionManager&gt;
  &lt;/DTS:ObjectData&gt;
&lt;/DTS:ConnectionManager&gt;


A couple of things to note:


The top node is &lt;DTS:Executable&gt;.  These &lt;DTS:ConnectionManager&gt; items are the next level down.
The above snip shows a static / fixed connection.  If you use an expression / dynamic connection, the XML code is a bit different:


  0
  MultiServer
  {02150dee-336e-4750-9159-3c4d3f0c62c3}
  

  OLEDB
  @[User::DynamicServerName]
  
    
      0
      Data Source=MyPC\SQL2008R2;Initial Catalog=master;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SQLOverview;
    
  



Please also note that all the code here has been formatted using an on-line XML formatter to aid readability.  In reality, each of these ConnectionManager XML snippets is on a single line of the .DTSX file.