0
我有.DAT文件,它看起來像下面的格式[沒有列名或標題,只有數據]:||是分隔符;所以,我有20個領域。導入DAT文件內容到SQL Server表使用導入導出嚮導 - 錯誤
worth||8000||AC8000||Tal||100||IN||O||2014-01-09 00:00:00||||N||N||N||Y||2014-01-09 00:00:00||Y||19991011||N||Internal||||N
我的SQL數據庫表也有20列。
當我使用的導入導出嚮導,我得到如下錯誤:
- Executing (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Column 0" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)
Error 0xc020902a: Data Flow Task 1: The "output column "Column 0" (10)" failed because truncation occurred, and the truncation row disposition on "output column "Column 0" (10)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)
Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "H:\servername\Account.20151201.dat\Account.20151201.dat" on data row 109.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Account_20151201_dat" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
注:我在數據庫表中的所有列有255字符。
請讓我知道,如何解決這個問題呢?我怎樣才能成功導入到我的數據庫。
感謝您的回覆。我已經將第一列的大小設置爲varchar(max)。而對於第二列,僅有它的20(用||隔開)。任何其他想法? – AskMe
請發送目的地表格的設計,以便我們可以將列與此DAT文件進行比較。 – InkHeart
另外檢查這可能會幫助你:http://stackoverflow.com/questions/1039385/truncation-errors-importing-to-sql-server-2005-from-excel?rq=1 – InkHeart