0

I have a table with a combined key (string + date) where the string is set as nvarchar with collate Latin1_General_CI_AS. My problem is now, that inserting words with 'ß' or 'ss' are threated equally and thus violating the uniqueness constraint. Changing nvarchar to varchar solves this problem, however, it has the drawback that some special characters are not allowed.

What can I do to preferably have a case insensitive but accent sensitive combined unique key? If possible, I prefer to create the database schema within ef core code first.

Phil
  • 135
  • 9
  • Does this answer your question? [Need a case insensitive collation where ss != ß](https://stackoverflow.com/questions/10351796/need-a-case-insensitive-collation-where-ss-%C3%9F) – Thom A Apr 18 '21 at 13:18
  • Does this mean I cannot have a unique key with ß != ss *The problem in that case was regarding uniqueness in a key column, not string comparison results, so to apply it in your situation (and compare two columns to do a single string comparison) might be unfeasible.* – Phil Apr 19 '21 at 07:32
  • The same solution applies in both. In your collation the 2 are equal, when you don't want them to be. – Thom A Apr 19 '21 at 07:43

0 Answers0