Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9209923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:57:31+00:00 2026-06-18T00:57:31+00:00

After I deploy a .dtsx SSIS package is there any query or C# code

  • 0

After I deploy a .dtsx SSIS package is there any query or C# code i could run to get it’s bath on the drive or could I retrieve the deployed .dtsx file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:57:32+00:00Added an answer on June 18, 2026 at 12:57 am

    As the package is stored in MSDB so Right Click on the SSIS package placed in SQL Server and then click Run Package .
    You will get a dialogue box

    enter image description here

    Click on the Connection Managers tab and then change the connetion strings for individual connection.

    Else

    if SSIS package is created using xml config file then click the configuration tab and open the config file to know the details of package

    Update 1:-

    1. Assigning values to SSIS package variables

    Add this namespace Microsoft.SqlServer.Dts.Runtime;

    Application app = new Application();
    Package package = null;
    package = app.LoadPackage(deployed ssis package path,null) //Load DTSX path
    //Access the SSIS variables
    pkg.Connections["sConn"].ConnectionString = strSourceConn;
    pkg.Connection["dConn"].ConnectionString = strDestConn;
    

    2.Reading XML

    Underlying code for every dtsx package is xml .So you can load the XML using C# and then iterate through each node and find the information .

    3.Getting information from dtsx.config file .

    As i said above the ssis package may have a xml config file which stores all the information.This xml file is much easier to read in C# then reading the entire DTSX package mentioned in point 2

    4.If package configuration is stored in sql server then use the below code .The code is taken from Collecting Information of SSIS package

        SELECT    Props.Prop.query('.') as PropXml,
        Props.Prop.value('declare namespace p1="www.microsoft.com/SqlServer/Dts";
        string(./@p1:Name)','nvarchar(max)')  as PropName,
        Props.Prop.value('.', 'nvarchar(max)') as PropValue
        FROM    (
        SELECT    CAST(pkgblob.BulkColumn AS XML) pkgXML
        FROM    OPENROWSET(bulk 'C:\tmp\MyPkg.dtsx',single_blob) AS pkgblob
        ) t
        CROSS    APPLY pkgXML.nodes('declare namespace DTS="www.microsoft.com/SqlServer/Dts";
                        /DTS:Executable/DTS:Property') Props(Prop)
    

    Conclusion :-

    If the SSIS package is created using config file . Locate where it is stored .
    If it is stored in XML configuration type then load that XML file in C# and search for the nodes . If the ssis data is stored in sql server then run the above sql and get all the information . The sql query returns you the package details in xml type which you can read in C# and get the desired information

    Update 2:-

    If SSIS package is deployed in sql server then the below code will help you retrieve the package details using C#

    public class SSISDetails
    {
        public string PackageData { get; set; }
        public string PackageName { get; set; }
    }
    
      string storedProc = string.Empty;
            List<SSISDetails> _pkgcol = new List<SSISDetails>();
            string connectionString = "server=localhost;Integrated Security=SSPI";
            using (var conn = new SqlConnection(connectionString))
            using (var command = new SqlCommand("SSISDetails", conn)
            {
                CommandType = CommandType.StoredProcedure
            })
            {
    
                conn.Open();
                SqlDataReader reader = command.ExecuteReader();
    
                    while (reader.Read ())
                    {
                        _pkgcol.Add(new SSISDetails() 
                        {
                           //Please don't write the code like the one below accessing 
                           //columns  using index .
                            PackageName =reader[2].ToString (),
                            PackageData =reader[10].ToString ()
                        });
    
                    }
    
                conn.Close();
            }
    
            foreach (var item in _pkgcol.Where (a=>a.PackageName =="YourPackageName") )
            {
                //read the item.PackageData and using Linq to xml retrieve the nodes which
                //you want
            }
    

    The Stored Proc which retrives the information is :-
    The below sql code gives the package name ,path,description and package data in xml format

     Create Procedure SSISDetails
     as 
     begin
     with ChildFolders
     as
     (
       select PARENT.parentfolderid, PARENT.folderid, PARENT.foldername,
        cast('' as sysname) as RootFolder,
        cast(PARENT.foldername as varchar(max)) as FullPath,
        0 as Lvl
       from msdb.dbo.sysssispackagefolders PARENT
       where PARENT.parentfolderid is null
       UNION ALL
       select CHILD.parentfolderid, CHILD.folderid, CHILD.foldername,
       case ChildFolders.Lvl
            when 0 then CHILD.foldername
            else ChildFolders.RootFolder
        end as RootFolder,
        cast(ChildFolders.FullPath + '/' + CHILD.foldername as varchar(max))
            as FullPath,
        ChildFolders.Lvl + 1 as Lvl
       from msdb.dbo.sysssispackagefolders CHILD
       inner join ChildFolders on ChildFolders.folderid = CHILD.parentfolderid
       )
       select F.RootFolder, F.FullPath, P.name as PackageName,
       P.description as PackageDescription, P.packageformat, P.packagetype,
       P.vermajor, P.verminor, P.verbuild, P.vercomments,
       cast(cast(P.packagedata as varbinary(max)) as xml) as PackageData
       from ChildFolders F
       inner join msdb.dbo.sysssispackages P on P.folderid = F.folderid
       order by F.FullPath asc, P.name asc;
    
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After I deploy an app to Heroku, I run migration scripts and get this
I have deploy.rb file with this pice of code: after :deploy do run if
I am constantly writing custom WebParts but after I deploy them, they always get
after first deploy with set :deploy_via, :copy for make changes in app now I'm
I am trying to deploy a playframework application to Heroku. After deploying, I trying
I made a solution to deploy a custom master page (a WSP file). After
I'm attempting to deploy a WPF application to IIS. After copying the files to
I am having a problem with Vlad on windows. After calling rake vlad:deploy I
After discovering about Javascript namespaces, I tried to implement them but I run into
After some time researching and trying different things I still cannot get my @ExceptionHandler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.