解析SSIS包

编程入门 行业动态 更新时间:2024-10-27 10:33:59
本文介绍了解析SSIS包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在文件系统上的文件夹中有几个.dtsx软件包。我尝试使用下一个脚本从该软件包中提取其他信息:

I have several .dtsx packages in the folder on file system. I try to extract additional information from the package with next script:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Microsoft.SqlServer.Server; using Microsoft.SqlServer.Dts.Runtime; using Microsoft.SqlServer.Dts; namespace ImportDataFromPackage { class Program { static void Main(string[] args) { // The pkg variable points to a package // installed with the SSIS samples. string pkg = @"D:\MyFolder\Ryder_project\testpackage\ACS\ACS_Available_Months.dtsx"; Application app = new Application(); Package p1 = app.LoadPackage(pkg, null); p1.Description = "CalculatedColumns package"; app.SaveToDtsServer(p1, null, @"File System\myp1Package", "YOURSERVER"); PackageInfos pInfos = app.GetDtsServerPackageInfos(@"File System", "YOURSERVER"); foreach (PackageInfo pinfo in pInfos) { Console.WriteLine("Package Information"); Console.WriteLine("CreationDate: {0}", pinfo.CreationDate); Console.WriteLine("Description: {0}", pinfo.Description); Console.WriteLine("Flags: {0}", pinfo.Flags); Console.WriteLine("Folder: {0}", pinfo.Folder); Console.WriteLine("Name: {0}", pinfo.Name); Console.WriteLine("PackageDataSize: {0}", pinfo.PackageDataSize); Console.WriteLine("PackageGuid: {0}", pinfo.PackageGuid); Console.WriteLine("VersionBuild: {0}", pinfo.VersionBuild); Console.WriteLine("VersionComments {0}", pinfo.VersionComments); Console.WriteLine("VersionGUID {0}", pinfo.VersionGUID); Console.WriteLine("VersionMajor {0}", pinfo.VersionMajor); Console.WriteLine("VersionMinor {0}", pinfo.VersionMinor); Console.WriteLine(); } } } }

,然后出现下一个错误:

请帮助我解决问题。

and I get next error:

Please help me to resolve the problem.

推荐答案

SSIS包 .dtsx 文件是Xml文件,因此可以使用XML Parser和其他技术,以正则表达式获取其信息。您可以使用SQL,.Net和其他技术来实现。

SSIS packages .dtsx files are Xml files, so you can use XML Parser and other techniques, Regular Expressions to get its informations. You can achieve this using SQL, .Net and other technologies.

您可以按照我对以下问题的详细回答:

You can follow my detailed answer to the following question:

  • 自动从以下版本中检索版本号.dtsx文件
  • Automate Version number Retrieval from .Dtsx files

此外,如果您正在寻找逆向工程,也可以查看以下链接:

Also if you are looking for a reverse engineering you can check the following link:

  • 使用C#进行逆向工程SSIS程序包
  • Reverse engineering SSIS package using C#

更多推荐

解析SSIS包

本文发布于:2023-10-27 16:18:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1533900.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SSIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!