There is some confusion as to what the various NULL settings all do in SSIS. In fact in one team where I worked we had created 15 packages before realising the full implications of the various default settings. Anyway, hopefully this article will help to clarify a bit......

Suppose you are doing a bog-standard import of a text file like the one below. We have a data flow task with a flat-file source going to a OLEDB destination. The flat file contains 3 columns: MyDate, MyInt and MyText. In the file there are 2 rows - one containing normal values and the other one just containing blank column values. So, what happens in the case of a blank value?

By default, what will happen is shown in the first dataset below (2nd row). A blank date will become "1st Jan 1753", an integer will become "0" and text will become "". Is this what you want? Usually not - especially if "0" is also a legitimate explicit numerical value in the text file!

So, we can designate that the null values from the flat file (really an absence of a value) will become a null in the resulting OLEDB destination. There is a little checkbox on the flat file source which controls this:

The imported dataset will now look like this:

So far so good.

However there is another similar setting available here. This is a checkbox on the OLEDB destination labelled as "Keep NULLs" - what is that for?

Basically this controls what happens when you have defaults on the destination table. If there is a default constraint on each column –

eg

the date should be today's date,

the number should be -1

the text "n/a"

- do we want these default values to be overwritten by NULL values or to simply apply their specified defaults?

The relevant option is shown below. In this particluar case the defaults won't get applied and will be overwritten by NULLs from the source file.

If it was unchecked, and the defaults mentioned above existed, we would arrive at the values below.

Hopefully this makes these 2 setting and the various permutations s a little clearer

原文链接

Retain NULL values vs Keep NULLs in SSIS Dataflows - Which To Use? (转载)的更多相关文章

  1. MySQL :: MySQL 8.0 Reference Manual :: B.6.4.3 Problems with NULL Values https://dev.mysql.com/doc/refman/8.0/en/problems-with-null.html

    MySQL :: MySQL 8.0 Reference Manual :: B.6.4.3 Problems with NULL Values https://dev.mysql.com/doc/r ...

  2. You can add an index on a column that can have NULL values if you are using the MyISAM, InnoDB, or MEMORY storage engine.

    w https://dev.mysql.com/doc/refman/5.7/en/create-index.html MySQL :: MySQL 5.7 Reference Manual :: B ...

  3. SQL NULL Values

    NULL代表缺失的.未知的数据.表的列值默认是NULL.如果某个表的某个列不是NOT NULL的,那么当我们插入新纪录.更新已存在的记录时,可以不用为此列赋值,这意味着那个列保存为NULL值. NUL ...

  4. NOT IN clause and NULL values

    https://stackoverflow.com/questions/129077/not-in-clause-and-null-values This issue came up when I g ...

  5. Elasticsearch的null values

    很多时候,我们需要面临null值的烦扰,查询es时传入null值是要查询出null的数据还是不查这个field呢,稍有不慎就会引发新的bug,这的确是个问题! null_value 意味着无法索引或搜 ...

  6. 微软BI 之SSIS 系列 - 对于平面文件中 NULL 值处理过程中容易极易混淆的几个细节

    开篇介绍 最近有人问我有关文件处理中空值处理的相关问题: OLE DB Destination 中的 Keep Nulls 如何控制 NULL 值的显示? 为什么选中了 Keep Nulls 但是数据 ...

  7. 微软BI SSIS 2012 ETL 控件与案例精讲面试 200 问(SSIS 面试题,ETL 面试题)

    开篇介绍 本自测与面试题出自 微软BI SSIS 2012 ETL 控件与案例精讲 (http://www.hellobi.com/course/21) 课程,对于学完本课程的每一课时和阅读完相关辅助 ...

  8. 微软BI SSIS 2012 ETL 控件与案例精讲课程学习方式与面试准备详解

    开篇介绍 微软BI SSIS 2012 ETL 控件与案例精讲 (http://www.hellobi.com/course/21) 课程从2014年9月开始准备,到2014年12月在 天善BI学院  ...

  9. SSIS 自测题-文件操作类

    说明:以下是自己的理解答案,不是标准的答案,如有不妥烦请指出.         有些题目暂时没有答案,有知道的请留言,互相学习,一起进步. 1.什么是控制流,什么是数据流,控制流和数据流之间的关系是什 ...

随机推荐

  1. 【Linux】Linux系统启动过程

    1.Linux系统的启动过程并不是大家想象中的那么复杂,其过程可以分为5个阶段: 内核的引导. 运行 init. 系统初始化. 建立终端 . 用户登录系统. 1.Linux系统的启动过程并不是大家想象 ...

  2. python爬取英语学习资料并发送邮件

    新建发送邮件类 import smtplib from email.mime.text import MIMEText from email.header import Header class Se ...

  3. $smarty->assign('','')查询结果发送给模板

    $article = one("select * from article WHERE id = '$id'"); $smarty->assign('abc(随便定义)',' ...

  4. sql:无法解决 equal to 操作中 "Chinese_PRC_CI_AS" 和 "Chinese_Taiwan_Stroke_CI_AS" 之间的排序规则冲突。

    --无法解决 equal to 操作中 "Chinese_PRC_CI_AS" 和 "Chinese_Taiwan_Stroke_CI_AS" 之间的排序规则冲 ...

  5. 原生js的math对象

    Math对象方法 //返回最大值 var max=Math.max(95,93,90,94,98); console.log(max); //返回最小值 var min=Math.min(95,93, ...

  6. 数组reduce和map方法

    1.有一个长度为100的数组,请以优雅的方式求出该数组的前10个元素之和 var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],sum ...

  7. IE8按F12开发人员工具不显示

    一直不喜欢用IE,不过为了项目需要,不得不使用IE 而且此功能只支持IE8,(⊙﹏⊙)b) 当按F12调出开发人员工具的时候发现显示不出来了,在任务栏里有显示,将鼠标放在任务栏的开发人员工具上, 背景 ...

  8. iDempiere 使用指南 系统安装 以及 virtualbox虚拟机下载

    Created by 蓝色布鲁斯,QQ32876341,blog http://www.cnblogs.com/zzyan/ iDempiere官方中文wiki主页 http://wiki.idemp ...

  9. 常见HTTP状态200,304,403,404,503

    下面提供 HTTP 状态码的完整列表.您也可以查看 W3C官方HTTP 状态码说明(英文). 1xx(临时响应) 表示临时响应并需要请求者继续执行操作的状态码. 100(继续) 请求者应当继续提出请求 ...

  10. js 常用排序整理

    排序: 1. 内部排序: (1). 交换排序: 1). 冒泡排序 稳定 一次比较相邻两个元素的大小,顺序错误的,将其位置互换 (从高位到低位 或者 从低位到高位) 初始版: var array = [ ...