SSIS将百分比转换为十进制 [英] SSIS Converting Percent to Decimal

查看:272
本文介绍了SSIS将百分比转换为十进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要获得一个百分比在我的数据库中显示为小数。
我有以下设置将百分比列转换为小数:

I'm trying to get a percentage to display as a decimal in my database. I have the following set up to convert the percentage columns into decimals:

----------------           ----------------           ------------
excel source     ---------> data conversion ----------> db output
----------------           ----------------           ------------

我试图将输入严格地转换为十进制和数字。
这两个都没有改变我的结果。

I've tried to strictly convert the input to decimal and numeric. Neither of these have changed my results.

在我的数据库中的列我只得到0和1。

In my columns in the database I'm getting just 0's and 1's.

原谅我的粗画;我没有足够的代表张贴图片。

Forgive my crude drawing; I do not have enough rep to post pictures yet.

推荐答案

希望这是您要查找的内容

Hope this is what you are looking for

我刚刚在我的系统中测试它。它工作正常。这是我做的。

I just tested it in my system.It is working fine. This is what I did.


  1. 创建了只有一个DFT的SSIS包。

  2. 数据流下面给出。请注意,在Excel工作表中显示为40%的值显示为0.40。所以我添加了两个派生列。一个转换本身,下一个转换为100。

导出的列结构如下所示。

the derived column structure is shown below.

>

目的地表结构

Create table Destination
(
id int,
name varchar(15),
hike decimal(8,2)
)



I am getting the result as expected.

Select * from Destination

>

这篇关于SSIS将百分比转换为十进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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