日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

sql2005数据导入出错问题

發(fā)布時(shí)間:2023/12/9 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 sql2005数据导入出错问题 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
最近在把一個(gè)大的文本文件中的數(shù)據(jù)導(dǎo)入到sql2005中時(shí),出現(xiàn)錯(cuò)誤。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

相同文件導(dǎo)入sql2000則不會(huì)出現(xiàn)錯(cuò)誤。

?

網(wǎng)絡(luò)上一查,也有部分人碰到這個(gè)問(wèn)題。解決的辦法2005年的時(shí)候,就有人貼出來(lái)了:

http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/94399ff2-616c-44d5-972d-ca8623c8014e/ 出錯(cuò)的原因各種各樣,里面有很多人列舉了自己的問(wèn)題。

?

主要原因是數(shù)據(jù)轉(zhuǎn)換的時(shí)候,sql2005中的缺省設(shè)置時(shí)字符長(zhǎng)度為50。對(duì)于有些數(shù)據(jù)來(lái)說(shuō),這個(gè)太短了,引起字符串被截?cái)?#xff0c;產(chǎn)生錯(cuò)誤。因此數(shù)據(jù)轉(zhuǎn)換中途停止。解決的辦法如下:

?

The flat file defaults initially all columns to characters with length of 50. You can change this by going to the “Advanced” page of the Flat File connection page and change the length manually, or you can click on "Suggest Types..." to get suggested column metadata attributes based on sampling a certain number of rows from the file.

?

就是在

?

When you enter your data source, you have an advanced tab on the left. After that, click on the offending column and one of the properties under 'Misc' on the right is OutputColumnWidth. Enter the correct value here and your problems will be gone. If you read the description for OutputColumnWidth you will see: "The width of this column in the data flow."

?

通過(guò)修改相關(guān)列的數(shù)據(jù)長(zhǎng)度,可以解決這個(gè)問(wèn)題。有些人比較夸張,一律把所有數(shù)據(jù)段的長(zhǎng)度改為8000(好像sql2000中缺省就是8000,這樣盡管不會(huì)出錯(cuò),但是太浪費(fèi)空間了。)

?

最有趣的有一個(gè)網(wǎng)友這樣感謝提出解決方案的人:

?

Thanks R2 DJ You have saved what little hair I have left on my head !! Steve 夠幽默!

?

實(shí)際上,如果能夠仔細(xì)閱讀出錯(cuò)信息,同時(shí)仔細(xì)觀(guān)察相關(guān)的文本文件的內(nèi)容,可以很快定位類(lèi)似問(wèn)題。當(dāng)然,如果碰上大文件,用notepad是無(wú)法解決問(wèn)題的,這個(gè)時(shí)候,用ultraedit等文本編輯工具可以處理大文本。

轉(zhuǎn)載于:https://blog.51cto.com/webservices/305702

總結(jié)

以上是生活随笔為你收集整理的sql2005数据导入出错问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。