Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

sql server - SSIS 2014 issue with currency (Without Decimal) in a flat file source

I am importing data from a flat file to Sql server database. In a flat file data comes without decimal like 3000 for 30.00. I tried setting up this column to DT_Decimal with DataScale 2 or DT_Numeric with precision (12 - 18) and DataScle 2 and I also tried DT_CY Currency. All these are inserting value as 3000.00 in database instead of 30.00. I don't know how to implement this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I did it with the following steps:

1) Created and opened, an SSIS project

2) Added a dataflow task

3) Created a flat file source

4) Created two step transform:

4a) Data Transformation to a dt_decimal

4b) Derived Column with the Expression: decColumn0 / 100

5) Ole DbDestination


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...