ssis 数据转换
In this article, I will first give an overview of SSIS data types and data types conversion methods and then I will illustrate the difference between changing the columns data types from the Source Advanced editor and using Data Conversion Transformation.
在本文中,我将首先概述SSIS数据类型和数据类型转换方法,然后说明从Source Advanced编辑器更改列数据类型与使用数据转换转换之间的区别。
This article is the seventh article in the SSIS feature face to face series, which aims to remove confusion and to illustrate some of the differences between similar features provided by SQL Server Integration Services.
本文是SSIS功能面对面系列文章中的第七篇,该文章旨在消除混淆并说明SQL Server Integration Services提供的相似功能之间的某些区别。
SSIS数据类型 (SSIS Data types)
When handling data using Integration Services Data Flow Task, the source data types are converted into SSIS data types. As an example, string data types are converted into DT_STR, DT_WSTR, DT_TEXT, DT_NTEXT data types.
使用Integration Services数据流任务处理数据时,源数据类型将转换为SSIS数据类型。 例如,字符串数据类型将转换为DT_STR,DT_WSTR,DT_TEXT,DT_NTEXT数据类型。
Microsoft provided very detailed information about SSIS data types and related data types on the different data sources. For more information, you can refer to the following links:
Microsoft在不同的数据源上提供了有关SSIS数据类型和相关数据类型的非常详细的信息。 有关更多信息,您可以参考以下链接:
- Integration Services Data Types Integration Services数据类型
- Working with Data Types in the Data Flow 在数据流中使用数据类型
The SSIS data types were founded to provide a unified set of data types that can handle different types from different sources. On the other hand, these data types have some limitations such as the minimum and maximum allowed values for the decimal data type, more detailed can be found at:
建立SSIS数据类型是为了提供一组统一的数据类型,可以处理来自不同来源的不同类型。 另一方面,这些数据类型有一些限制,例如十进制数据类型的最小和最大允许值,有关更多详细信息,请参见:
数据类型转换方法 (Data Types Conversion Methods)
There are two types of data type conversion:
数据类型转换有两种类型:
- Implicit conversion 隐式转换
- Explicit conversion 显式转换
In this section, I will try to make a quick overview of each type.
在本节中,我将尝试快速概述每种类型。
隐式转换 (Implicit Conversion)
Implicit conversions are not visible to the user. Data types are automatically converted from one data type to another. For example, when a string is compared to an int, the string is implicitly converted to int before the comparison proceeds:
隐式转换对用户不可见。 数据类型会自动从一种数据类型转换为另一种数据类型。 例如,当将一个字符串与一个int比较时,在比较进行之前&#x