从高级编辑器更改数据类型与数据转换转换 [英] Change data types from Advanced Editor vs Data Conversion Transformation

查看:113
本文介绍了从高级编辑器更改数据类型与数据转换转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SSIS创建一些程序包。我对数据转换转换组件和从高级编辑器更改列数据类型感到困惑

I am using SSIS to create some packages. I have gotten confused around the Data Conversion Transformation component and changing columns data types from Advanced editor

如果我可以进入高级编辑器并进行更改是我的输出的数据类型,为什么我需要输入数据转换转换?

If I can go into the advanced editor and change the data type of my output, why would I need to input the Data Conversion Transformation?

这仅仅是出于偏爱还是两种方法之间有区别? / p>

Is this just down to preference or is there a difference between using both approaches?

推荐答案

在显示这两种方法之间的差异之前,我将尝试概述数据转换类型。

有两种不同类型的数据类型转换:

There are 2 different type of data type conversion:


  • 隐式转换:隐式转换对用户不可见。 SQL Server自动将数据从一种数据类型转换为另一种数据类型。例如,当将smallint与int比较时,在进行比较之前,将smallint隐式转换为int。

  • 显式转换:显式转换使用CAST或CONVERT函数或其他工具。

从下面的Microsoft Grid中,您可以看到每种方法可以转换哪些数据类型:

From the following Microsoft Grid you can see what data types can be converted with each approach:

如果您需要了解与SSIS数据类型相关的SSIS数据类型是什么SQL Server数据库引擎(在上面的网格中提到),那么您可以参考以下文档:

If you need to know what are the SSIS data types relevant to the data types of SQL Server database engine (mentioned in the Grid above), then you can refer to the following documentation:

  • Integration Services Data Types

  • 高级编辑器,您正在执行隐式数据类型转换,因为源/目标组件会尝试自动转换列的数据类型。

  • 使用数据转换转换,您正在执行显式转换。既然在上面的文章中提到过,

  • When changing data types from the Advanced editor you are performing implicit data types conversion since the Source/Destination Component try to convert automatically the data type of the column.
  • Using Data Conversion Transformation you are performing explicit conversion. Since it is mentioned on the article above that:

使用数据转换转换来 cast从一种数据类型到另一种数据类型的列的数据类型

更多详细信息,请参见:

More details can be found at:

  • SSIS Data types: Change from the Advanced Editor vs Data Conversion Transformations
  • Data type conversion (Database Engine)
  • Data Conversion Transformation
  • Working with SSIS Data Types

这篇关于从高级编辑器更改数据类型与数据转换转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆