使用 SSIS 包复制多个表

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

我正在尝试设计一个 SSIS 包,它将大约 50 多个表从 ODBC 数据源(QuickBooks DB)复制到 SQL DB.我应该创建 50 个数据流任务来执行此操作吗?做这个的最好方式是什么 ?将 DFT 放入循环中,然后读取表格?或者 50+ 数据流任务???

I am trying to design an SSIS package which copy about 50+ tables from an ODBC DataSource (QuickBooks DB) to an SQL DB. Should I create 50 Data Flow Task to do this ? What is the best way to do this ? Putting DFT inside a Loop, and reading the tables ? Or 50+ Data Flow Tasks ???

推荐答案

您可以创建 50 个数据流任务,但不是必须的.

You can create 50 Data Flow Tasks, but you don't have to.

在同一个 DFT 中可以有多个独立的源-目的地.这将不那么灵活,因为您可以独立于包运行单个 DFT(在调试时),但您不能在不修改它的情况下运行一段 DFT(据我所知).

It is possible to have multiple independent sources-destinations in the same DFT. This will be not as flexible, because you can run single DFT separately from the package (while debugging), but you cannot run a piece of DFT without modifying it (as far as I know).

根据您选择的选项,我看到了几种方法可以让您免于处理 50 多张桌子的平凡工作:

Depending on which option you choose, I see a couple of ways to save yourself from mundane work with 50+ tables:

a) 让 SQL Server 导入和导出向导做无聊的事为你工作.这个工具最好的地方是它可以创建一个 .dtsx 包.

a) Let SQL Server Import and Export Wizard do the boring work for you. The best about this tool is that it can create a .dtsx package.

因此,使用向导,您可以:

So, with the wizard, you can:

  • 选择从 ODBC 数据源导入所有 50 多个表
  • 不要一直运行向导,而是将结果保存为 .dtsx 包.
  • 使用 SQL Server Data Tools 在 Visual Studio 中打开包
  • 根据您的需要修改包(例如,在不同的 DFT 中对表进行逻辑重组,添加任何其他转换).

b) 手动编辑包代码(一些BIML 知识可能需要):

b) Manually edit the package code (some BIML knowledge might be needed):

  • 在带有 SQL Server Data Tools 的 Visual Studio 中,创建 1 个 DFT 作为您的示例.
  • 在 Solution Exporer 中,右键单击您的包,选择查看代码.
  • 复制/粘贴 DFT 50 次以上,更改表名,或者您甚至可以设法以某种方式自动化 BIML 以避免复制/粘贴

更多推荐

使用 SSIS 包复制多个表

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

发布评论

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

>www.elefans.com

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