Wrox的《Professional Microsoft SQL Server 2012 Integration Services》一书中再讲Merge的时候有这样一段解释:

This transformation is similar to the Union All Transformation, but the Merge Transformation has
some restrictions that may cause you to lean toward using Union All:
  1)The data must be sorted before the Merge Transformation. You can do this by using the Sort
    Transformation prior to the merge or by specifying an ORDER BY clause in the source connection.
  2)The metadata must be the same between both paths. For example, the CustomerID column
    can’t be a numeric column in one path and a character column in another path.
  3)If you have more than two paths, you should choose the Union All Transformation.

经过试验,不止Merge对输入双方数据栏位类型上有严格的要求,其实Union All也一样,如果你输入A中的A字段是INT,输入B中的A字段是VARCHAR,这样在Union All中做Mapping的时候是会报错的。

A输入:

B输入:

Union All属性页面做Mapping报错:

不过话虽如此,如果一开始mapping没问题,然而在运行Data Flow前加入一个Execute SQL Task来每次都重建表呢?这样Union All是否会像SQL Server中的Union All一样自动进行数据类型转换呢?

建表的时候A表和B表中的col3都是varchar类型,Union All也认为它是varchar,目标表对应字段col2是varchar类型。然而加了一个Execute SQL Task来每次都重建表,把A表的col3改成int类型。这样做非但没有报错,数据也可以进入到了目标表。说明了这样Int兼容了varchar。

反过来,试下初始化的时候为都为int,然后运行的时候一个改为varchar,这种情况下结果是,无论目标表的对应字段为int或者varchar都能进入表中且package执行成功,说明只要数据本身内容可以转换为int就可以。SSIS或者说Union All组件自动转换数据类型。

Data Flow ->> Union All的更多相关文章

  1. SSIS ->> Control Flow And Data Flow

    In the Control Flow, the task is the smallest unit of work, and a task requires completion (success, ...

  2. [转]Data Flow How-to Topics (SSIS)

    本文转自:http://technet.microsoft.com/en-us/library/ms137612(v=sql.90).aspx This section contains proced ...

  3. SSIS Data Flow优化

    一,数据流设计优化 数据流有两个特性:流和在内存缓冲区中处理数据,根据数据流的这两个特性,对数据流进行优化. 1,流,同时对数据进行提取,转换和加载操作 流,就是在source提取数据时,转换组件处理 ...

  4. Data Flow的Error Output

    一,在Data Flow Task中,对于Error Row的处理通过Error Output Tab配置的. 1,操作失败的类型:Error(Conversion) 和 Truncation. 2, ...

  5. SSIS Data Flow 的 Execution Tree 和 Data Pipeline

    一,Execution Tree 执行树是数据流组件(转换和适配器)基于同步关系所建立的逻辑分组,每一个分组都是一个执行树的开始和结束,也可以将执行树理解为一个缓冲区的开始和结束,即缓冲区的整个生命周 ...

  6. SSIS的 Data Flow 和 Control Flow

    Control Flow 和 Data Flow,是SSIS Design中主要用到的两个Tab,理解这两个Tab的作用,对设计更高效的package十分重要. 一,Control Flow 在Con ...

  7. Intel® Threading Building Blocks (Intel® TBB) Developer Guide 中文 Parallelizing Data Flow and Dependence Graphs并行化data flow和依赖图

    https://www.threadingbuildingblocks.org/docs/help/index.htm Parallelizing Data Flow and Dependency G ...

  8. SSIS ->> Data Flow Design And Tuning

    Requirements: Source and destination system impact Processing time windows and performance Destinati ...

  9. Data Flow ->> Import Column & Export Column

    这两个transformation的作用是把DT_TEXT, DT_NTEXT, DT_IMAGE类型的数据在文件系统和数据库间导出或者导入.比如把某个数据库表的image类型的字段导出到文件系统成为 ...

随机推荐

  1. 软件工程课堂练习——N层电梯只停一层求乘客爬楼层数最少(基本方法+优化方法)

    题目: •石家庄铁道大学基础大楼一共有四部电梯,每层都有人上下,电梯在每层都停.信1201-1班的张一东觉得在每层都停觉得不耐烦. •由于楼层不太高,在上下课高峰期时时,电梯从一层上行,但只允许停在某 ...

  2. linux设备驱动第五篇:驱动中的并发与竟态

    综述 在上一篇介绍了linux驱动的调试方法,这一篇介绍一下在驱动编程中会遇到的并发和竟态以及如何处理并发和竞争. 首先什么是并发与竟态呢?并发(concurrency)指的是多个执行单元同时.并行被 ...

  3. 网页数据采集 - 系列之Flash数据采集

    经常看到一些朋友在讨论如何采集flash中的数据,讨论来讨论区,结论就是:flash不能采集,其实也不总是这样.本篇就跟大家分享如何采集flash中的数据. 在开始之前,先说明一下:一般来说flash ...

  4. HDU 3555 Bomb 数位dp

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3555 Bomb Time Limit: 2000/1000 MS (Java/Others) Mem ...

  5. linux I/O

    一) I/O调度程序的总结     1) 当向设备写入数据块或是从设备读出数据块时,请求都被安置在一个队列中等待完成.     2) 每个块设备都有它自己的队列.     3) I/O调度程序负责维护 ...

  6. 【转载】MyBatis之传入参数

    原文地址:http://blog.csdn.net/liaoxiaohua1981/article/details/6862764 在MyBatis的select.insert.update.dele ...

  7. 【BZOJ】【1004】【HNOI2008】Cards

    Burnside/Polya+背包DP 这道题目是等价类计数裸题吧……>_> 题解:http://m.blog.csdn.net/blog/njlcazl_11109/8316340 啊其 ...

  8. Codeforces Round #274 (Div. 2)

    A http://codeforces.com/contest/479/problem/A 枚举情况 #include<cstdio> #include<algorithm> ...

  9. Nodejs Express 4.X 中文API 1--- Application篇

    相关阅读: Express 4.X API 翻译[一] --  Application篇 Express4.XApi 翻译[二] --  Request篇 Express4.XApi 翻译[三] -- ...

  10. ZendStudio导入一个已有的网站

    解决方法:新建'PHP Project',选择'Create project at existiong location(from existing source)',路径指向你的网站根目录.