土耳其语SQL排序规则的问题(土耳其语"I") [英] Problems with Turkish SQL Collation (Turkish "I")

查看:200
本文介绍了土耳其语SQL排序规则的问题(土耳其语"I")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我们的MSSQL数据库设置为任何土耳其文归类时遇到问题.由于存在土耳其语I"问题,因此我们所有包含"i"的查询均无法正常工作.例如,如果在这种情况下定义了一个带有"UnitID"列的名为"Unit"的表,则查询"select unitid from unit"将不再起作用,因为"id"中的小写字母"i"与定义的大写字母不同我在"UnitID"中.错误消息将显示为无效的列名'unitid'."

I'm having problems with our MSSQL database set to any of the Turkish Collations. Becuase of the "Turkish I" problem, none of our queries containing an 'i' in them are working correctly. For example, if we have a table called "Unit" with a column "UnitID" defined in that case, the query "select unitid from unit" no longer works because the lower case "i" in "id" differs from the defined capital I in "UnitID". The error message would read "Invalid column name 'unitid'."

我知道发生这种情况是因为在土耳其语中,字母i和我被视为不同的字母.但是,我不确定如何解决此问题?不能遍历数据库中的所有1900 SP,并更正"i"的大小写.

I know that this is occurring because in Turkish, the letter i and I are seen as different letters. However, I am not sure as to how to fix this problem? It is not an option to go through all 1900 SPs in the DB and correct the casing of the "i"s.

我们将不胜感激,甚至可以建议使用其他排序规则代替土耳其语,但会支持其字符集.

Any help would be appreciated, even suggestions of other collations that could be used instead of Turkish but would support their character set.

推荐答案

事实证明,最好的解决方案实际上是重构所有SQL和代码.

Turns out that the best solution was to in fact refactor all SQL and the code.

最近几天,我编写了一个重构应用程序,以修复所有存储的proc,函数,视图,表名保持一致并使用正确的大小写,例如:

In the last few days I've written a refactoring app to fix up all Stored procs, functions, views, tablenames to be consistent and use the correct casing eg:

select unitid from dbo.unit 

将更改为

select UnitId from dbo.Unit

然后,该应用程序还将遍历代码,并替换存储的proc及其参数的所有出现,并更正它们以匹配数据库中定义的大小写.该应用程序中的所有数据表均设置为不变的语言环境(这要感谢FXCop指出了所有数据表.),这可以防止在代码内进行的调用必须区分大小写.

The app also then goes through the code and replaces any occurrences of the stored proc and its parameters and corrects them to match the case defined in the DB. All datatables in the app are set to invariant locale (thanks to FXCop for pointing out all the datatables..), this prevents the calls from within code having to be case sensitive.

如果有人想要该应用程序或有关该过程的任何建议,可以通过dotnetvixen@gmail.com与我联系.

If anyone would like the app or any advice on the process you can contact me on dotnetvixen@gmail.com.

这篇关于土耳其语SQL排序规则的问题(土耳其语"I")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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