July 31, 2013 at 4:42 am
Hi,
Source: multiple text file
Requirement:
1. Define age columns as small integer.
2. Convert gross column from $ 667 00 to 667.00 and change datatype from string to money.
3. Convert date format from 12122012 to 12/12/2012 and change datatype from string to date data type.
4. Finally load all flat file to a db table in sql server using a single destination.
For which I converted gross column using dervied column transformation and for date column using substring.
Now i can't able to change gross and date columns datatype from string to money and date data type.
Please help me to solve this issue....
Thanks in advance
August 1, 2013 at 8:30 am
if you want to do data conversion, like convert string to money, I suggest to use 'Data Conversion' instead of 'Derived Column', it's easier.
August 1, 2013 at 11:40 pm
Thanks for the reply...
I tried even using data conversion, still its not working... one of my friend suggest me to use temp table convert using query and load it into destination, I don't know how to use that......
Please suggest..........
August 7, 2013 at 11:57 am
for example, convert string '$123456789' to money 1234567.89
1. Use Data Coversion to convert '$123456789' to data type currency[DT_CY], it will be 123456789 in a new output alia after this step.
2. Use Derived Column to change 123456789 to 123456789, just divided by 100. You need to make sure all values have two decimals. it generates a new column.
3. Then you can insert the new column generated in step#2 into money column on destination table.
you can also right click data source (ex. Flat File Source), Show Advanceded Editor -> Input and Output Properties - > Flat File Source Output -> Output Columns, to change the DataTypethe of the column to currency[DT_CY], so that you don't have to use Data Conversion. But I usually use it. It's up to you.
If the value in text file has already has decimal, you don't have to use step #2.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply