SSIS百分比列从Excel - > SQL Server [英] SSIS the Percentage column from Excel -> SQL Server
本文介绍了SSIS百分比列从Excel - > SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个将Excel数据导入到SQL Server 2000数据库的SSIS包。
I am trying to create a SSIS package that will import Excel data to SQL Server 2000 database.
Excel工作表中的一列是百分比格式,而我希望以字符串格式导入该列,因此显示45.22%而不是0.4522。
One of the column in Excel sheet is in Percentage format and I wish to import that column in string format so it displays 45.22% instead of 0.4522.
有没有办法在SSIS中执行此操作?
Is there a way of doing this within SSIS?
推荐答案
使用派生列添加基于表达式的新列:
Use derived column to add new column based on expression:
(DT_WSTR,20)(COL1 * 100) + "%"
它将COL1乘以100 ,将其转换为WSTR(unicode字符串),并在末尾添加百分号。
It multiplies COL1 by 100, converts it to WSTR (unicode string) and adds percent-sign at the end.
这篇关于SSIS百分比列从Excel - > SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文