简体   繁体   English

如何才能使SSIS查找转换忽略字母大小写?

[英]How can I get SSIS Lookup transformation to ignore alphabetical case?

Hopefully this is easy to explain, but I have a lookup transformation in one of my SSIS packages. 希望这很容易解释,但我在我的一个SSIS包中进行了查找转换。 I am using it to lookup the id for an emplouyee record in a dimension table. 我用它来查找维度表中的emplouyee记录的id。 However my problem is that some of the source data has employee names in all capitals (ex: CHERRERA) and the comparison data im using is all lower case (ex: cherrera). 但是我的问题是一些源数据在所有大写中都有员工姓名(例如:CHERRERA),并且使用的比较数据都是小写的(例如:cherrera)。

The lookup is failing for the records that are not 100% case similar (ex: cherrera vs cherrera works fine - cherrera vs CHERRERA fails). 对于不是100%情况类似的记录,查找失败(例如:cherrera vs cherrera工作正常 - cherrera vs CHERRERA失败)。 Is there a way to make the lookup transformation ignore case on a string/varchar data type? 有没有办法在字符串/ varchar数据类型上进行查找转换忽略大小写?

我认为没有办法使转换不区分大小写,但是您可以修改转换的SQL语句,以确保源数据与比较数据的大小写匹配,方法是使用LOWER()字符串函数。

Set the CacheType property of the lookup transformation to Partial or None. 将查找转换的CacheType属性设置为Partial或None。

The lookup comparisons will now be done by SQL Server and not by the SSIS lookup component, and will no longer be case sensitive. 查找比较现在将由SQL Server完成,而不是由SSIS查找组件完成,并且不再区分大小写。

您必须更改源以及查找数据,两者都应该是相同的案例类型。

Based on this Microsoft Article : 基于这篇Microsoft文章

The lookups performed by the Lookup transformation are case sensitive. Lookup转换执行的查找区分大小写。 To avoid lookup failures that are caused by case differences in data, first use the Character Map transformation to convert the data to uppercase or lowercase. 为避免由数据中的大小写差异导致的查找失败,请首先使用“字符映射”转换将数据转换为大写或小写。 Then, include the UPPER or LOWER functions in the SQL statement that generates the reference table 然后,在生成引用表的SQL语句中包含UPPER或LOWER函数

To read more about Character Map transformation , follow this link" 要阅读有关字符映射转换的更多信息,请点击此链接“

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM