SSIS:代码页返回到65001 [英] SSIS: Code page goes back to 65001

查看:148
本文介绍了SSIS:代码页返回到65001的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我正在编写的SSIS程序包中,我有一个CSV文件作为源.在连接管理器"的常规"页面上,它的 65001 作为代码"页面(我正在测试某些东西).未检查Unicode.

In an SSIS package that I'm writing, I have a CSV file as a source. On the Connection Manager General page, it has 65001 as the Code page (I was testing something). Unicode is not checked.

这些列使用 varchar 列(以及其他列)映射到SQL Server目标表.

The columns map to a SQL Server destination table with varchar (among others) columns.

目标位置出现错误:无法处理列名"列,因为为其指定了多个代码页(65001和1252).

There's an error at the destination: The column "columnname" cannot be processed because more than one code page (65001 and 1252) are specified for it.

由于其他使用SQL列的应用程序,我的SQL列必须为 varchar ,而不是 nvarchar .

My SQL columns have to be varchar, not nvarchar due to other applications that use it.

然后在连接管理器"的常规"页面上,将代码"页面更改为 1252(ANSI-Latin I),然后退出,但是当我再次打开它时,它又回到了 65001 .是否(仅出于测试目的)我是否检查Unicode都没有影响.

On the Connection Manager General page I then change the Code page to 1252 (ANSI - Latin I) and OK out, but when I open it again it's back to 65001. It doesn't make a difference if (just for test) I check Unicode or not.

请注意,所有这一切都是在CSV文件和SQL表添加和删除列(用户,您知道的)之后发生的.在那之前,我没有任何问题.是的,我在高级编辑器"中刷新了OLE DB目标.

As a note, all this started happening after the CSV file and the SQL table had columns added and removed (users, you know.) Before that, I had no issues whatsoever. Yes, I refreshed the OLE DB destination in the Advanced Editor.

这是SQL Server 2012,以及BIDS和SSIS附带的任何版本.

This is SQL Server 2012 and whichever version of BIDS and SSIS come with it.

推荐答案

65001代码页= Unicode(UTF-8)

65001 Code page = Unicode (UTF-8)

基于此 Microsoft文章(平面文件连接管理器):

代码页
指定非Unicode文本的代码页.

Code page
Specify the code page for non-Unicode text.

您可以通过以下方式配置平面文件连接管理器:

You can configure the Flat File connection manager in the following ways:

指定要使用的文件,语言环境和代码页.语言环境用于解释对语言环境敏感的数据,例如日期,,而代码页用于将字符串数据转换为Unicode.

Specify the file, locale, and code page to use. The locale is used to interpret locale-sensitive data such as dates, and the code page is used to convert string data to Unicode.

因此,当平面文件具有Unicode编码时:

So when the flat file has a Unicode encoding:

然后无法更改此属性,它将始终恢复为原始编码.

Then this property cannot be changed, it will always return to it original encoding.

有关代码页标识符的更多信息,请参考本文:

For more infor about the Code Page identifiers, you can refer to this article:

这篇关于SSIS:代码页返回到65001的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆