MSSQL Unique Index/Key with accent sensitive collate (ss != ß, ...) EF Core Code First

212 Views Asked by At

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.

0

There are 0 best solutions below