SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS ( cannot able to change datatype column using datatype conversion......


SSIS ( cannot able to change datatype column using datatype conversion......

Author
Message
llllllllllllllllll
llllllllllllllllll
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 43
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
SillyDragon
SillyDragon
SSC-Enthusiastic
SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)

Group: General Forum Members
Points: 100 Visits: 188
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.
llllllllllllllllll
llllllllllllllllll
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 43
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..........
SillyDragon
SillyDragon
SSC-Enthusiastic
SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)

Group: General Forum Members
Points: 100 Visits: 188
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search