SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Strange T-SQL behaviour using Hungarian collation


Strange T-SQL behaviour using Hungarian collation

Author
Message
ChrisMaene
ChrisMaene
SSC Rookie
SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)

Group: General Forum Members
Points: 37 Visits: 1
This a nice one!
Has anyone ever deployed a SQL2000 or SQL7 database using a Hungarian collation(Hungarian_CI_AS)?
I've encountered some very strange behaviour in T-SQL statements, more specifically in stored procedures. It appears that (I swear, i'm not joking) every variable, table name or field name used in a sp containing the word 'year' (eg:FinancialYear, YearOfBirth...) suddenly becomes case sensitive?! If you, for instance write the following :

DECLARE @FinancialYear SMALLINT
...
SELECT @Financialyear = FinancialYear FROM Table1 --notice the spelling of the variable

Using the Hungarian collation Hungarian_CI_AS
this will fail reporting error : Must declare the variable '@Financialyear'.

The strange thing is that, all other variables, not containing the word 'year', appear not to have this problem, you can mix case however you want... no problem.

I have never heard of T-SQL being case sensitive.
I'm guessing that this is a bug.

Has anyone ever encountered such behaviour ?



Site Owners
Site Owners
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: Administrators
Points: 12701 Visits: 22
No one has responded to this topic yet. Even if you don't have a complete answer, the original poster will appreciate any thoughts you have!
joachim.verhagen
joachim.verhagen
SSChasing Mays
SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)

Group: General Forum Members
Points: 660 Visits: 194
I tried it on SQLServer 2000 SP3, but can not reproduce it.

Could it be that in your version SQLServer believes that in Hungarian Y is not the capital of y?



ChrisMaene
ChrisMaene
SSC Rookie
SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)

Group: General Forum Members
Points: 37 Visits: 1
Somehow I doubt that this is the case since other words containing capital Y don't show this behaviour. But thanks for trying. It really seems to be related to the word YEAR. Maybe because YEAR is also a function...blablabla... Bottom line is that it just doesn't make sense...



Cade Roux
Cade Roux
Old Hand
Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)

Group: General Forum Members
Points: 388 Visits: 491
The problem is not Y, but LY - Hungarian has a special LY letter: http://en.wikipedia.org/wiki/Hungarian_alphabet
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search