dbTalk Databases Forums  

SSIS Transform column to another datatype

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS Transform column to another datatype in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JB
 
Posts: n/a

Default SSIS Transform column to another datatype - 02-13-2006 , 09:53 AM






Hello,

I want to put data from an Access-database into a SQL-server2005
database, using SSIS Data Flow. The problem I've got is that I cannot
convert a string value (like '20060101' for the first of januari 2006)
from the Access database into a Datetime value in the SQL-database. I
try to use a Data Conversion in SSIS, but none of the available
possibilities to convert the input string into a date are
successfull...

It does not support changing the datatype of the column, using the cast
functions does not work either. I also tried to convert using the
Derived Column Transormation, but that one also fails...

When I use SUBSTRING to get the parts of the date and then append them
together to mm/dd/yyyy then my string gets more than 8 characters and
SSIS fails because of that.

Can anyone please tell me how to do this conversion? It should be very
simple!

Thanks in advance,
Jeroen


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS Transform column to another datatype - 02-13-2006 , 03:54 PM






Hello JB,

You could use a script component as a transform.


Or you could use a derived column transform with this as the expression where
dt == column

RIGHT(dt,2) + "/" + SUBSTRING(dt,5,2) + "/" + SUBSTRING(dt,1,4)

and you output to a datatype of database_timestamp





Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Hello,

I want to put data from an Access-database into a SQL-server2005
database, using SSIS Data Flow. The problem I've got is that I cannot
convert a string value (like '20060101' for the first of januari 2006)
from the Access database into a Datetime value in the SQL-database. I
try to use a Data Conversion in SSIS, but none of the available
possibilities to convert the input string into a date are
successfull...

It does not support changing the datatype of the column, using the
cast functions does not work either. I also tried to convert using the
Derived Column Transormation, but that one also fails...

When I use SUBSTRING to get the parts of the date and then append them
together to mm/dd/yyyy then my string gets more than 8 characters and
SSIS fails because of that.

Can anyone please tell me how to do this conversion? It should be very
simple!

Thanks in advance, Jeroen




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.