开发者

Why when I try to output a query result to CSV in SSIS instead of decimal numbers I get ones and zeros?

I have created a very simple Data Flow in SSIS that is run inside a loop.

IMAGE 1 http://img407.imageshack.us/img407/1553/step1f.jpg

I have a simple OLE DB Source control which is connecting to a SQL Server and running quite a complex query to split daily data by 30 minute intervals as shown below.

IMAGE 2 http://img168.imageshack.us/img168/857/step2vs.jpg

I then have a Flat File Destination control which is taking the output from the OLE DB Source control and saving it as a comma-delimited CSV file. As you can see above the numbers are dec开发者_如何学Cimal numbers to two decimal places but in the CSV file below it is showing as ones and zeros.

IMAGE 3 http://img341.imageshack.us/img341/5494/step3w.jpg

What can I do to get the CSV output to match the query input? I have tried converting the numbers to varchar in the query but I got the same result. I also tried changing the column types in the Connection Manager too but got the same result.


I have managed to resolve this issue by changing all the DataType properties for each column of data I was importing. I had to change them to 'double-precision float [DT_R8]' and then it saved the CSV with the proper decimal values.

Very annoying, I hope that helps someone.

IMAGE 4 http://img687.imageshack.us/img687/3749/step4dp.jpg

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜