List All Object of SSIS Packag that stored in SSISDB in SQL Server 2016 using C#

manish verma 421 Reputation points
2022-02-12T13:41:59.283+00:00

HI ALL,

i Have package stored in SQL Server 2016- in SSISDB.

i want to get details

Package Name, Source Information, Target Information, Control Flow Object used in Page, Data Flow Object In Package. for this i got information from Microsoft Site

https://learn.microsoft.com/en-us/sql/integration-services/run-manage-packages-programmatically/enumerating-available-packages-programmatically?view=sql-server-ver15

In this link, code mention i am using

using System;
using Microsoft.SqlServer.Dts.Runtime;

namespace EnumeratePackagesSql_CS
{
class Program
{
static void Main(string[] args)
{

  string sqlFolder;      
  string sqlServer;      
  string sqlUser;      
  string sqlPassword;      
  
  Application ssisApplication;      
  PackageInfos sqlPackages;      
  
  sqlFolder = String.Empty;      
  sqlServer = "(local)";      
  sqlUser = String.Empty;      
  sqlPassword = String.Empty;      
  
  ssisApplication = new Application();      
  
  sqlPackages = ssisApplication.GetPackageInfos(sqlFolder, sqlServer, sqlUser, sqlPassword);      
  
  foreach (PackageInfo sqlPackage in sqlPackages)      
  {      
    Console.WriteLine(sqlPackage.Name);      
  }      
  
  Console.Read();      
  
}      

}
}

here folder name i given of my SSISDB, it will error out when i give path -/SSISDB/testpackage/TestProjectSSIS, please help me here what folder path i need to give here

also in sql user name i am login using user sa , is sa user can i use here to get details of package

173756-image.png

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,456 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,279 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,555 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 24,296 Reputation points Microsoft Vendor
    2022-02-14T09:43:42.34+00:00

    @manish verma , accoording to my research, I find that it will be hard to read the package XML in the sql server directly. Maybe that we need to move the package file to other places, like D disk.

    Then you could use the following link to read the package XML in the sql server.

    how-to-query-xml-as-used-in-dtsx-ssis


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.