Retain NULL values vs Keep NULLs in SSIS Dataflows - Which To Use? (转载)
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? (转载)的更多相关文章
- 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 ...
- 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 ...
- SQL NULL Values
NULL代表缺失的.未知的数据.表的列值默认是NULL.如果某个表的某个列不是NOT NULL的,那么当我们插入新纪录.更新已存在的记录时,可以不用为此列赋值,这意味着那个列保存为NULL值. NUL ...
- NOT IN clause and NULL values
https://stackoverflow.com/questions/129077/not-in-clause-and-null-values This issue came up when I g ...
- Elasticsearch的null values
很多时候,我们需要面临null值的烦扰,查询es时传入null值是要查询出null的数据还是不查这个field呢,稍有不慎就会引发新的bug,这的确是个问题! null_value 意味着无法索引或搜 ...
- 微软BI 之SSIS 系列 - 对于平面文件中 NULL 值处理过程中容易极易混淆的几个细节
开篇介绍 最近有人问我有关文件处理中空值处理的相关问题: OLE DB Destination 中的 Keep Nulls 如何控制 NULL 值的显示? 为什么选中了 Keep Nulls 但是数据 ...
- 微软BI SSIS 2012 ETL 控件与案例精讲面试 200 问(SSIS 面试题,ETL 面试题)
开篇介绍 本自测与面试题出自 微软BI SSIS 2012 ETL 控件与案例精讲 (http://www.hellobi.com/course/21) 课程,对于学完本课程的每一课时和阅读完相关辅助 ...
- 微软BI SSIS 2012 ETL 控件与案例精讲课程学习方式与面试准备详解
开篇介绍 微软BI SSIS 2012 ETL 控件与案例精讲 (http://www.hellobi.com/course/21) 课程从2014年9月开始准备,到2014年12月在 天善BI学院 ...
- SSIS 自测题-文件操作类
说明:以下是自己的理解答案,不是标准的答案,如有不妥烦请指出. 有些题目暂时没有答案,有知道的请留言,互相学习,一起进步. 1.什么是控制流,什么是数据流,控制流和数据流之间的关系是什 ...
随机推荐
- python 批量ping服务器
最近在https://pypi.python.org/pypi/mping/0.1.2找到了一个python包,可以用它来批量ping服务器,它是中国的大神写的,支持单个服务器.将服务器IP写在txt ...
- UML建模概述
UML的组成主要有事物.图.关系. UML中的事物: (1)构件事物:UML模型的静态部分,描述概念或物理元素,包括以下 a. 类:类是对一组具有相同属性.相同操作.相同关系和相同语义的对象的抽象.包 ...
- UML建模—EA的使用起步
Enterprise Architect(EA) 是一个功能比较强悍的建模工具. 对于一个软件设计者来说,从需求分析到业务设计.类模型设计.数据库设计到测试.发布.部署等一系列软件设计必须的操作都可以 ...
- spring cloud Eureka 服务注册发现与调用
记录一下用spring cloud Eureka搭建服务注册与发现框架的过程. 为了创建spring项目方便,使用了STS. 一.Eureka注册中心 1.新建项目-Spring Starter Pr ...
- 关于Java中用Double型运算时精度丢失的问题
注:转自 https://blog.csdn.net/bleach_kids/article/details/49129943 在使用Java,double 进行运算时,经常出现精度丢失的问题,总是在 ...
- for循环的几种比较
对一个集合遍历的3种方法:1.for(int i=0;i<list.size();i++) 2.for(int i=0,len=list.size();i<len;i++) 3.for ( ...
- JQuery.iviewer
from: http://test.dpetroff.ru/jquery.iviewer/test/# jquery.iviewer.js: /* * iviewer Widget for jQuer ...
- python调用其他文件的类和函数
在同一个文件夹下 调用函数 source.py文件: def func(): pass new.py文件: import source # 或者 from source import func 调用类 ...
- sass继承
@extend sass中,选择器继承可以让选择器继承另一个选择器的所有样式,并联合声明.使用选择器的继承,要使用关键词@extend,后面紧跟需要继承的选择器. scss.style css.sty ...
- AE常用代码(标注要素、AE中画带箭头的线、如何获得投影坐标、参考坐标、投影方式、FeatureCount注意事项)
手上的电脑已经用了将近三年了,想入手一台Surface Pro,所以计划着把电脑上的资料整理下,部分资料打算发到博客上来,资料有同事.也有自己的.也有来自网络的,来源途径太多,也没法详细注明,请见谅! ...