Sybase ASE 创建外键约束忽略大小写
我试图从 ASE 15.5
中获得与 MSSQL 2008
中存在的不区分大小写的相同功能。
排序顺序必须保持二进制,应用程序才能在标准模式下工作,但是新表 - 产品的增强具有外键,我希望它们不区分大小写。
也就是说,如果 tableA
具有值 ABC
,则 tableB
应该能够在 tableA
上拥有外键,并且插入值aBc
。
我能够通过这样做解决类似的索引问题:
create nonclustered index myindex on mytable(**upper**(mycolumn))
并且索引现在用于执行不区分大小写的匹配,如果我这样做:
select * from mytable where upper(mycolumn) = upper('My Value')
但我不知道如何执行不区分大小写的外键。
非常感谢任何帮助。 谢谢
I am trying to get same functionality out of ASE 15.5
that exists in MSSQL 2008
in terms of case insensitivity.
Sort order has to remain binary for the application to work in standard mode, however new tables - enhancement to the product have foreign keys, and I'd like for them to be case insensitive.
That is, if tableA
has a value ABC
, than tableB
should be able to have foreign key on tableA
and insert value aBc
.
I was able to solve similar issue with indexing, by doing this:
create nonclustered index myindex on mytable(**upper**(mycolumn))
And index now gets used for doing case-insensitive matching, if I do:
select * from mytable where upper(mycolumn) = upper('My Value')
But I can't figure out how to do case-insensitive foreign key.
Any help is greatly appreciated.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我相信您需要在新表上编写更新和插入触发器,以对父表列进行适当的检查。 《交易》第 20 章 -SQL 指南应该包含完成该任务所需的信息。
I believe you need to write an update and an insert trigger on the new table that does the appropriate checks against the parent table columns. Chapter 20 of the Transact-SQL guide should have the information you need to accomplish that.