I tried to load into the Flat file with Timestamp format , its loading perfectlyDSguru2B wrote:Try changing it. Also, since this is such a struggle, load it to a flat file, just a few records to see how it looks like. It should have two parts. The first is date in the format YYYY-MM-DD and second is time in the format HH:NN:SS. Both parts should have a single space in between them.
Date conversion to SQL server
Moderators: chulett, rschirm, roy
I tried to load into Flat file with sqltype Timestamp sucessfullyDSguru2B wrote:Try changing it. Also, since this is such a struggle, load it to a flat file, just a few records to see how it looks like. It should have two parts. The first is date in the format YYYY-MM-DD and second is time in the format HH:NN:SS. Both parts should have a single space in between them.
Did you spot check a few fields in the flat file. Is the conversion correct?. Also in my initial input, ICONV for time should be "MTHS" instead of "MT" This conversion will only be successful if there is no space between seconds and AM/PM. If there is space you need to get rid of that space then.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
While Searching the forum I found this post
viewtopic.php?t=102661&highlight=
viewtopic.php?t=102661&highlight=
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Did you used Convert()? May I know the code that you used? I too lazy to search for that.us1aslam1us wrote:Hi Kumar, I tried that part at my end but the issue seems to be with time part, But waiting for OP's response.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
As noted, its may be due the datatype mismatch. You cannot load varchar as it is in to a Date field. You need to have a date conversion at the target stage.pavanns wrote:i tried doing it with varchar all the way but does not work as it says cannot insert null into the column.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Is it possible that your getting null from source and trying to insert to a not null column?pavanns wrote:i tried doing it with varchar all the way but does not work as it says cannot insert null into the column.
None of the rows get inserted?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.