问题描述
有一个非常简单的 SSIS 包:
Have a pretty straight forward SSIS package:
- OLE DB Source 通过视图获取数据,(db 表 nvarchar 或 nchar 中的所有字符串列).
- 用于格式化现有日期并将其添加到数据集的派生列(数据类型 DT_WSTR).
- 多播任务将数据集拆分为:
- OLE DB 命令将行更新为已处理".
- 平面文件目标 - 其连接管理器设置为代码页 65001 UTF-8,未选中 Unicode.所有字符串列都映射到 DT_WSTR.
每次我运行这个包时,都会在 Notepad++ 中打开它的 ANSI 平面文件,而不是 UTF-8.如果我选中 Unicode 选项,则该文件是 UCS-2 Little Endian.
Everytime I run this package an open the flat file in Notepad++ its ANSI, never UTF-8. If I check the Unicode option, the file is UCS-2 Little Endian.
我做错了什么 - 如何让平面文件采用 UTF-8 编码?
Am I doing something wrong - how can I get the flat file to be UTF-8 encoded?
谢谢
推荐答案
OK - 似乎在 SQL Server 论坛.基本上我必须创建两个 UTF-8 模板文件,使用文件任务将它们复制到我的目的地,然后确保我是附加数据而不是覆盖.
OK - seemed to have found an acceptable work-around on SQL Server Forums. Essentially I had to create two UTF-8 template files, use a File Task to copy them to my destination then make sure I was appending data rather than overwriting.
这篇关于SSIS - 平面文件总是 ANSI 从不使用 UTF-8 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!