SQL Server issue / collation

Today I had a strange situation in the customer database. SQL Server 2005, database sorting is case insensitive, so I can write SQL queries anyway without any problems ... except one. One particular column in one particular table is called "DeadZone". If I ask like this: 'select Deadzone from TableName' - I get a column of an error not found like this: 'select DeadZone from TableName' - it works. Now the kicker, like this: 'select deadZone from TableName' - it works!

Thus, only the β€œZ” in the column name is case sensitive! I created a similar column name in the same table with "Z" in it, and this column is not case sensitive.

Any ideas? I'm sure I can get around this, possibly dropping and adding a column again, but it would be nice to figure this out. BTW, the database is located on a PC in Hungary, so is it possible that some problems with the Hungarian character are causing this? Remembering that another column name with "Z" in it did not have the same problem.

-Graeme

+6
database sql-server collation
Aug 26 '11 at 16:08
source share
1 answer

What is exact matching? Hungarian has a special letter Dz that can be matched differently than D - so your problem could be d, not z.

Deadzone is [D][e][a][dz][o][n][e] DeadZone is [D][e][a][d][Z][o][n][e] deadZone is [d][e][a][d][Z][o][n][e] 

I would vote +1000 for you for that strange thing that I saw this month, if I could.

See related issue with LY: http://www.sqlservercentral.com/Forums/Topic19439-9-1.aspx

And I don't think resetting and re-adding a column will help. You should probably only use Hungarian column names if you intend to use the Hungarian database!

+6
Aug 26 '11 at 16:12
source share



All Articles