SSIS XML 处理

发布于 2024-09-05 06:14:04 字数 331 浏览 0 评论 0原文

在我的工作中,我需要导入大量(产品)数据。最近我们开始使用 SSIS,它确实比自定义 .net 导入工具更好。经过 3 个项目后,我们发现使用带有 c# xpath 和 sql 语句的脚本任务比在数据流中使用 XML 源和合并联接更有效。

数据流的问题

  • 有时 xml 无法从变量中读取
  • 它太依赖于 XML 的固定定义(需要知道 xsd)
  • 当定义更改时,需要更改整体
  • 特定类型处理; UINT 和 INT 不一样
  • 不像 C# 代码那样容易调试和单步执行

任何人都可以分享他们的 SSIS XML 导入故事

For my job I do very big imports of (product) data. Recently we started using SSIS and it sure works better then custom .net import tools. Still after 3 projects we figured out it's more efficient to use an scripttask with c# xpath and sql statements then to use XML source and merge joins in a dataflow.

Problems with a dataflow

  • Sometimes the xml cannot read from a variable
  • It depends too much on a fixed definition of XML (the xsd needs to be known)
  • When definitions change a whole needs to be altered
  • To specific type handling; UINT and INT arn't the same
  • Not easy to debug and step through as C# code

Can anyone share their SSIS XML import stories

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那请放手 2024-09-12 06:14:04

我在 SQL Server 中“一直”使用 XML,主要是我的一些项目中的导入功能。由于 XML 结构的限制,我不使用 SSIS XML 源。例如,无法从“Excel XML”导入数据,其中不仅数据而且列名都是值。为了准备这种导入,我使用 TSQL 代码。也许对于这个例子,您可以使用第三方组件,但并非所有客户都愿意为此付费。))

I work "all the way" with XML in SQL Server and mainly it is import feature in some of my projects.I do not use SSIS XML source because of limitation of XML structure. As example, it is not possible to import data from "Excel XML", where not only data but column names are as values. To prepare this kind of import, i use TSQL code. Maybe for this example you can use third-party components, but not all customers want to pay for that.))

放我走吧 2024-09-12 06:14:04

您可以尝试在 CodeProject 上尝试使用一些第 3 方组件,或者如果您的 C#/VB 技能适合的话,那么可以考虑卷起袖子编写一个源脚本组件来使用 SAX 解析器分解 xml。这将允许数据流通过 XML 传输,而不是将整个内容加载到 DOM 中。

You could try experimenting with some of the 3rd party components on CodeProject, or if your C#/VB skills are up for it, then consider rolling up your sleeves and writing a source script component to shred the xml using a SAX parser. This will allow the data flow to stream over the XML instead of loading the entire thing into a DOM.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文