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. GCC笔记

    The History of GCC 1984年,Richard Stallman发起了自由软件运动,GNU (Gnu's Not Unix)项目应运而生,3年后,最初版的GCC横空出世,成为第一款可 ...

  2. 【Convert Sorted Array to Binary Search Tree】cpp

    题目: Given an array where elements are sorted in ascending order, convert it to a height balanced BST ...

  3. Leetcode#61 Rotate List

    原题地址 我一直不太理解为什么叫rotate,翻译成"旋转"吧,似乎也不像啊.比如: 1->2->3->4->5->NULL 向右旋转2的距离,变成了 ...

  4. Vim 中使用cscope

    使用cscope碰到的问题 1. E568: duplicate cscope database not added 根据提示,cscope数据库重复添加了,我使用的是vim7.2版本,而这个版本在已 ...

  5. WinHex分析PE格式(2)&& 如何手动添加区段并运行区段

    由于这次文章内容比较多 所以写成DOC文档 为了复习所学的知识,我在原本的软件里试者手动加入区段 ,并写给大家分享,还试试者用LordPE加区段发现竟然失败了, 还是自己动手比较实在,完美运行. 利用 ...

  6. C51关键字

    C51 中的关键字 关键字 用途 说明 auto 存储种类说明 用以说明局部变量,缺省值为此 break 程序语句 退出最内层循环 case 程序语句 Switch语句中的选择项 char 数据类型说 ...

  7. PowerDesigner(七)-数据库的生成和修改(转)

    数据库的生成和修改 使用ODBC接口连接数据库 访问数据库 预测数据库大小 生成数据库及数据库对象 PDM与用户数据库的同步 使用测试数据 暂不详述.

  8. ASP.NET为图片加上水印

    为我们发布的图片加上一个水印,也是我们经常要做的事情,那怎么样来做呢,下面就一步步开始吧 首先是一个制作水印的类:ImageHandler,代码如下: using System; using Syst ...

  9. asp.net 认证与授权

    1.下面的例子在web.config文件中配置网站使用asp.net forms 身份认证方式: <configuration> <system.web> <authen ...

  10. Android的Testing和Instrumentation

    Android提供了一系列强大的测试工具,它针对Android的环境,扩展了业内标准的JUnit测试框架.尽管你可以使用JUnit测试Android工程,但Android工具允许你为应用程序的各个方面 ...