我有一個困惑,我無法弄清楚。我正在嘗試在SQL數據庫表中導入平面文件,但遇到問題。 SQL中的我的列是出生日期DOB的日期時間列。提供給我的提取平面文件具有此列日......因此,當我輸入蛋白到SQL我越來越:
Messages
Error 0xc0202009: Data Flow Task 1: 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 date format".
(SQL Server Import and Export Wizard)
Error 0xc020901c: Data Flow Task 1: There was an error with input column "DOB" (212) on input "Destination Input" (147). The column status returned was: "Conversion failed because the data value overflowed the specified type.".
(SQL Server Import and Export Wizard)
Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (147)" failed because error code 0xC020907A occurred, and the error row disposition on "input "Destination Input" (147)" 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.
(SQL Server Import and Export Wizard)
我試圖找出如何添加一個隨機的時間像00:00:00.000到平面文件中的每個DOB。例如,他們發給我1983-11-30但我想用1983-11-30 00:00:00.000
有沒有辦法做到這一點,或者有沒有人有我能做什麼的想法?在此先感謝
這不應該是一個問題(至少,不是你想象的那個)。當DATETIME列僅收到日期時,它會自動假定時間爲「00:00:00.000」。這裏最可能出現的問題是日期格式,SQL Server可能假設日期的格式是'YYYY-DD-MM'而不是'YYYY-MM-DD'。 – Lamak
在運行之前嘗試執行SET DATEFORMAT ymd批量插入。 –
謝謝....我認爲我的問題是其他地方...我跑了一個通過格式保持不變,它假設0就像你想的。謝謝 –