SSIS 在 Unicode 和非 Unicode 错误之间转换 [英] SSIS Convert Between Unicode and Non-Unicode Error
问题描述
我有一个 ssis 包,我在其中使用了链接到 SQL Server 2005 表的 OLEDB 源.除日期列之外的所有列都是 NVARCHAR(255).我正在使用 Excel 目标并使用 SQL 语句在 Excel 工作簿中创建工作表,SQL 位于 excel 连接管理器中(实际上是创建工作表的创建表语句),并从列的映射派生而来数据库.
I have an ssis package where I am using an OLEDB source linking to SQL Server 2005 table. All columns except a date column are NVARCHAR(255). I am using an Excel destination and using a SQL statement to create the sheet in the Excel workbook, the SQL is in the excel connection manager (effectively a create table statement that creates a sheet) and is derived from the mapping of the columns from the DB.
无论我做了什么,我总是收到这个 unicode --> 源和目标之间的非 unicode 转换错误.尝试在 S > D 之间转换为 string[DT_STR],将其删除,将 SQL 表 VARCHAR 更改为 NVARCHAR,但仍然出现此翻转错误.
No matter what I have done I keep getting this unicode --> non-unicode conversion error between my source and destination. Tried conversion to string[DT_STR] between S > D, removed it, changed SQL Table VARCHAR to NVARCHAR and still get this flippin error.
因为我使用 SQL 语句在 Excel 中创建工作表,所以我看不到任何实际预定义 Excel 工作表中列的数据类型的方法.我想这将是一个默认的元数据,但我不知道.
Because I am creating the sheet in Excel with a SQL statement I do not see any way to actually pre-define what the data types of the columns will be in the Excel sheet. I imagine it would be a default meta data but I do not know.
那么在我的 SQL 表目标和使用这个 SSIS sql 语句创建我的 Excel 工作表之间,我怎样才能阻止这个错误出现?
So between my SQL table destination and the creation of my Excel sheet with this SSIS sql statement how can I stop this error coming up?
我的错误是:
数据流任务中的错误 [OLE DB 源 [1]]:列MyColumn"无法在 unicode 和非 unicode 字符串数据类型之间转换.
Error at Data Flow Task [OLE DB Source [1]]: Column "MyColumn" cannot convert between unicode and non-unicode string data types.
对于所有 nvarchar 列.
And for all nvarchar columns.
感谢任何帮助
谢谢
安德鲁
推荐答案
以下步骤对我有用:
右键单击源任务.
right click on source task.
点击显示高级编辑器".
click on "Show Advanced editor".
- 转到输入和输出属性"标签.
选择出现错误的输出列.
select the output column for which you are getting the error.
它的数据类型将为String[DT_STR]".
Its data type will be "String[DT_STR]".
将该数据类型更改为Unicode String[DT_WSTR]".
Change that data type to "Unicode String[DT_WSTR]".
- 保存并关闭.
希望这会有所帮助!
这篇关于SSIS 在 Unicode 和非 Unicode 错误之间转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!