I’ve got a database with a CI default collation (French_CI_AS)
Under this collation, SQL Server will do case insensitive checks on my foreign keys, which makes sense, but is causing me quite a few problems, mostly because string comparison doesn’t have the same behavior in my database tier and in my application tier
I’ve got probably around twenty varchar PKs and hundreds of FKs on those varchar PKs (yes, I know using only bigint as PKs would have avoided the issue in the first place, but moving from varchar to bigint is not an option here)
What’s the easiest way to sort this out? I’m using SQL Server 2008.
You could try to change the collation of the column to case sensitive, but then you will need to cast the column (or other columns to the same colation) when you use it in joins or comparisons.