Um...forgot to mention you'll be importing from DT_STR to varchar(32) column that you create on the table.
Main Topics
Browse All TopicsHi I am very new to SSIS so the answer to this may be very easy indeed - dont forget to suggest the obvious!
I am importing a csv file in which the first column represents a date, and is in the form:
2007-04-25 00:00:00.000
The output column data type is DT_STR and the destination SQL table column is of type datetime. At the moment I get the following error messages:
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Invalid character value for cast specification".
[OLE DB Destination [9]] Error: There was an error with input column "Column 0" (93) on input "OLE DB Destination Input" (22). The column status returned was: "The value could not be converted because of a potential loss of data.".
Please can you tell me what I need to do to make the import work?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi necrit and thanks for your info. I would like to try out your solution but it seems quite complicated and doesn't appear to use functionality that is available within SSIS and without the need for coding, which I would prefer if possible.
In particular I was expecting the answer to make use of the Data Conversion component which sounds like exactly what I am trying to do.
Is there a simple way to use a Data Conversion component to read in a DT_STR column (from the Flat File Data Source component) and feed the OLEDB Destination component, such that it can populate a 'datetime' SQL field?
Thanks, This looks like it will work but I havent tried it yet, I have discovered that the Derived Column Transformation within SSIS probably contains the solution, but I have not got it working yet. So I have today posted a new question that focuses more on the pursuit of a Derived Column solution, entitled:
'How to use SSIS Derived Column Transformation to load string into datetime SQL field'
Business Accounts
Answer for Membership
by: necritPosted on 2009-10-06 at 21:01:52ID: 25512126
Quickest fix i know is to import it into a field with an appended value of _Import so TicketModifedDate_Import would be an example. Then run an update query sqltask in the SSIS job that will do an update to the table where the import datafield is SET. The below example code shows how you would first test your server to see if you can aptly transform the string to datetime.
Let me know if you have any questions
Select allOpen in new window