当前位置:  开发笔记 > 数据库 > 正文

SQL 2005 CSV导入引号用内部引号和逗号分隔

如何解决《SQL2005CSV导入引号用内部引号和逗号分隔》经验,为你挑选了0个好方法。

我有一个带引号文本分隔符的CSV文件.大多数90000行都很好,但是我有一些行包含一个包含引号和逗号的文本字段.例如,字段值将是:

AB",AB

当划界时,这就成了

"AB" "AB"

当SQL 2005尝试导入这个时,我得到的错误如...

Messages
Error 0xc0202055: Data Flow Task: The column delimiter for column "Column 4" was not found.
 (SQL Server Import and Export Wizard)

只有当引号和逗号一起处于文本值时,才会出现这种情况.价值观

AB"AB变为"AB""AB"或AB,AB变为"AB,AB"

工作得很好.

以下是一些示例行...

"1464885","LEVER WM","","B","MP17"
"1465075",":PLT-BC   !!NOTE!!","","B",""
"1465076","BRKT-STR MTR            !NOTE!","","B",""
"1465172",":BRKT-SW MTG   !NOTE!","","B","MP16"
"1465388","BUSS BAR                !NOTE!","","B","MP10"
"1465391","PLT-BLKHD     ""NOTE""","","B","MP20"
"1465564","SPROCKET:13TEETH,74MM OD,66MM","ID W/.25"" SETSCR","B","MP6"
"S01266330002","CABLE:224"",E122/261,8 CO","","B","MP11"

最后一行是问题的一个例子 - "",导致错误.

推荐阅读
k78283381
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有