Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 converting string to date in SSIS

Author  Topic 

Bostonrose
Starting Member

3 Posts

Posted - 2007-01-29 : 15:24:29
I am very new to SSIS though I have written hundreds of SQL 2000 dts' with all kinds of active scripts doing all kinds of things. I am now trying to convert them to SSIS and since scripts don't come through the migrator I am doing them by hand once again. I have the package created, but one of the input fields on the text file is YYYYMMDD , but the database field it is going into is a datetime so I need to convert it to a valid date format so that the conversion will take place. I tried data conversion task but that doesn't work, now I'm assuming I need to use the derived column, but not sure and don't have a clue how to use that, can anyone help? Thanks bostonrose

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-29 : 15:26:32
No need. A text with numeric value in the format YYYYMMDD is internallt casted as datetime, if target column is datetime.

If not, add a derived column.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Bostonrose
Starting Member

3 Posts

Posted - 2007-01-29 : 15:54:39
I tried that, but it still gave me the error. It seems now that it doesn't recognize the end of the text file, but tacks on two strange characters to the beginning of each new text record so that on the second and every row after the date isn't what it should be. any idea what I haven't told it about my text file I need to. It is fixed format. Thanks, Boston rose
Go to Top of Page
   

- Advertisement -