1

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

Robert
  • 25,425
  • 8
  • 67
  • 81
Alex
  • 1,192
  • 14
  • 30

2 Answers2

1

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.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
hshana
  • 11
  • 1
  • 1
0

This should work

create nonclustered index myindex on mytable(upper(mycolumn))

when you run this

select * from mytable where upper(mycolumn) = upper('My Value')

in the query plan you will see index myindex in query plan. It works only on sybase 15

Robert
  • 25,425
  • 8
  • 67
  • 81