问题
if I bang my head on my desk 1 more time I might be gone forever.
Source: Excel
Data: 2012-10-05T11:14:00
Conversion:
2012-10-05T11:14:00 in Excel to string [DT_STR]
Destination: SQL
Column Data Type: datetime
I keep getting the following errors:
[PostBindInspectionsBucket [20]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Invalid character value for cast specification".
[PostBindInspectionsBucket [20]] Error: There was an error with input column "Copy of RequestTimestamp" (112) on input "OLE DB Destination Input" (33). The column status returned was: "The value could not be converted because of a potential loss of data.".
[PostBindInspectionsBucket [20]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "OLE DB Destination Input" (33)" failed because error code 0xC0209077 occurred, and the error row disposition on "input "OLE DB Destination Input" (33)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "PostBindInspectionsBucket" (20) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (33). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
What am I doing wrong? the format that's coming from Excel is a valid datetime format.
I created a table with a column of type "datetime" and then I pasted in it "2012-10-05T11:14:00" and it worked fine.
I also ran a
SELECT ISDATE('2012-10-05T11:14:00')
and it's returning 1, which means it's a valid datetime in SQL.
Anyone know what could be the issue?
回答1:
The issue here was the "T".
I removed the T from the string it went through.
来源:https://stackoverflow.com/questions/15799270/ssis-datetime-conversion-issue-between-excel-and-sql