SSIS 数据迁移:将平面表拆分为父表子/孙桌

发布于 2024-08-09 05:20:59 字数 602 浏览 3 评论 0原文

我需要将位于 SQL Server 2005 中的大型平面表中的数据迁移到由父表和多个子表组成的新 SQL Server 2005 架构中。这似乎与 SSIS 中的合并或合并联接相反,但我不明白如何实现这一点。任何建议都将不胜感激。你见过其他人如何完成此类事情的例子吗?

平面源表 [FlatSource] 具有 < 280K 记录和一些垃圾数据,所以我需要在某个时候处理这​​些事情。但现在,这是我需要完成的要点...

平面源表将主要映射到新的父表 [Parent]。也就是说:对于[FlatSource]中的每条记录,我需要将这条记录移动到[Parent]中。

完成此操作后,我需要记录这个新父记录的 PK 并添加大量子记录。当向子表 [Child1] 添加 0-4 条记录时,将使用此 PK。基本上可能有 0-4 列,如果填充这些列,则需要在 [Child1] 中创建一个新记录,该记录将使用来自 [Parent] 的 PK。

完成此操作后,我需要将 0-4 个新记录填充到 [孙] 中,这些记录将使用 [子] 中的 PK。

感谢您提供的任何见解。我已经开始了一个 C# 项目,但我越深入研究它,它就越像是 SSIS 的任务。

此致,

乔什·布莱尔 科罗拉多州戈尔登

I need to migrate data in a large flat table located in SQL Server 2005 into a new SQL Server 2005 schema that consists of a parent table and multiple child tables. This seems like the opposite of a merge or merge join in SSIS but I don't understand how I would go about accomplishing this. Any recommendations are greatly appreciated. Ever seen any examples of how other accomplish this sort of thing?

The flat Source table [FlatSource] has < 280K records and some garbage data so I will need to handle these things at some point. But for now, here is gist of what I need to accomplish...

The flat source table will mostly map to the new parent table [Parent]. That is to say: For each record in the [FlatSource], I need to move this record into [Parent].

Once this is done, I need to record the PK of this new parent record and add numerous child records. This PK will be used when adding 0-4 records into a child table [Child1]. Basically there may be 0-4 columns that if populated will require a new record in [Child1] that will use the PK from the [Parent].

Once this is done, I will need to populate 0-4 new records into [Grandchild] that will use the PK from [Child].

Thanks for any insight you can offer. I have started a project in C# but the more I dig into it, the more it seems like a task for SSIS.

Sincerely,

Josh Blair
Golden, CO

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

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

发布评论

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

评论(1

゛清羽墨安 2024-08-16 05:20:59

看起来这可能是“条件 splt”数据流任务的任务。这将位于您的数据源之后,并且您将在组件本身内添加不同的 split 条件。

当连接目标的条件分割时,您可以指定目标正在接收哪个“条件”。正如你可以有很多条件,你也可以有很多目的地。

It looks like this would have been the task for a 'conditional splt' data flow task. This would have sat after your data source, and you would have added different splt conditions within the component itself.

When connecting destinations the the conditional split, you can specify which 'condition' is being recieved by the destination. As you can have many conditions, you can have many destinations.

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