CSV中的变音字符但在SQL Server导入向导中变为奇怪的字符

时间:2016-06-29 23:01:07

标签: sql csv ssms-2014

我有一个编码为UTF-8的CSV文件,我从IMDb.com下载。我想使用导入向导将此数据导入SSMS 2016(或2014)。以下是CSV的样子(注意达拉斯买家俱乐部的主管是Jean-Marc Vall é e):

"position","const","created","modified","description","Title","Title type","Directors","You rated","IMDb Rating","Runtime (mins)","Year","Genres","Num. Votes","Release Date (month/day/year)","URL"
"38","tt1636826","Tue Feb 16 00:00:00 2016","","","Project X","Feature Film","Nima Nourizadeh","6","6.7","88","2012","comedy, crime","155628","2012-03-01","http://www.imdb.com/title/tt1636826/"
"39","tt0119528","Tue Feb 16 00:00:00 2016","","","Liar Liar","Feature Film","Tom Shadyac","6","6.8","86","1997","comedy, fantasy, romance","217817","1997-03-18","http://www.imdb.com/title/tt0119528/"
"40","tt0790636","Tue Feb 16 00:00:00 2016","","","Dallas Buyers Club","Feature Film","Jean-Marc Vallée","7","8.0","117","2013","biography, drama","321602","2013-09-07","http://www.imdb.com/title/tt0790636/"

我在导入向导中选择平面文件源,选择我的文件,然后使用默认选项(同时添加“作为文本限定符)。但是,这是我所看到的示例:{{3 }}

变音符号é正在变成é。我尝试在导入向导中选择“区域设置”旁边的Unicode,但它将所有内容转换为中文字符并将其全部放在一个单元格中。

知道这里发生了什么吗?

1 个答案:

答案 0 :(得分:1)

将平面文件连接上的编码更改为代码页65001(UTF-8),并确保数据类型为unicode字符串DT_WTSR。

此链接有更多分步指导。 https://www.mssqltips.com/sqlservertip/3119/import-utf8-unicode-special-characters-with-sql-server-integration-services/