Unix Technical Forum

SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

This is a discussion on SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi All I am facing following issue with SQL server 2000. If, while creating DB, I choose collation as ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 10:05 PM
Ajay Bansal
 
Posts: n/a
Default SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Hi All

I am facing following issue with SQL server 2000. If, while creating DB, I
choose collation as Chinese_PRC_BIN, SQL server becomes case sensitive.

e.g. if Table name is "MYTABLE", following query fails

select * from mytable

however, if collation is default (English) , then following query works
fine.

What is the issue here?

Regards
Ajay


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 10:05 PM
m.bohse@quest-consultants.com
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Ajay,

you have chosen a binary sort-order. Since the binary value for 'T' is
different from 't' the database is effectively case sensitive.
Markus

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 10:05 PM
Ajay Bansal
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

But then, why does it work for database if collation is english?

<m.bohse@quest-consultants.com> wrote in message
news:1138091684.802799.211120@g44g2000cwa.googlegr oups.com...
> Ajay,
>
> you have chosen a binary sort-order. Since the binary value for 'T' is
> different from 't' the database is effectively case sensitive.
> Markus
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 10:05 PM
=?Utf-8?B?TUw=?=
 
Posts: n/a
Default RE: SQL server becomes case sensitive if I choose collation as : Chine

Yes, binary collations are case sensitive.


ML

---
http://milambda.blogspot.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 10:05 PM
Tibor Karaszi
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Can you elaborate on that? Are you saying that an "English" database collation which is binary
doesn't make object names case sensitive? Can you in that case name that exact collation name so we
can test it?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/


"Ajay Bansal" <ajay.bansal02@gmal.com> wrote in message
news:erHXzGMIGHA.1028@TK2MSFTNGP11.phx.gbl...
> But then, why does it work for database if collation is english?
>
> <m.bohse@quest-consultants.com> wrote in message
> news:1138091684.802799.211120@g44g2000cwa.googlegr oups.com...
>> Ajay,
>>
>> you have chosen a binary sort-order. Since the binary value for 'T' is
>> different from 't' the database is effectively case sensitive.
>> Markus
>>

>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 10:05 PM
Erland Sommarskog
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Ajay Bansal (ajay.bansal02@gmal.com) writes:
> I am facing following issue with SQL server 2000. If, while creating DB, I
> choose collation as Chinese_PRC_BIN, SQL server becomes case sensitive.
>
> e.g. if Table name is "MYTABLE", following query fails
>
> select * from mytable
>
> however, if collation is default (English) , then following query works
> fine.
>
> What is the issue here?


Precisely what you have discovered, that the collation rules of the
database applies to system objects as well. Consider, for instance this
as well:

CREATE DATABASE test1 COLLATE Finnish_Swedish_CI_AI
go
USE test1
go
CREATE TABLE V(w int NOT NULL)
go
INSERT w (v) VALUES (12)
go
SELECT * FROM W
go
USE master
go
DROP DATABASE test1

(In Swedish W is not a letter of its own, but just a variation of V.)

My recommendation is to always develop on a database with a case-
sensitive (or binary) collation, and use only lowercase names. If
you develop on case-insensitive, you will face a nightmare if the
customer says that they want a case-insensitive or binary collation.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-27-2008, 10:05 PM
Ajay Bansal
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Ok.. lets go back a step here..

How do I know, if in a SQL serevr database - collation is binary? I mean -
does _BIN specify that collation is binary?


"Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.co m> wrote in
message news:eTSV2LMIGHA.3036@tk2msftngp13.phx.gbl...
> Can you elaborate on that? Are you saying that an "English" database
> collation which is binary doesn't make object names case sensitive? Can
> you in that case name that exact collation name so we can test it?
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
>
> "Ajay Bansal" <ajay.bansal02@gmal.com> wrote in message
> news:erHXzGMIGHA.1028@TK2MSFTNGP11.phx.gbl...
>> But then, why does it work for database if collation is english?
>>
>> <m.bohse@quest-consultants.com> wrote in message
>> news:1138091684.802799.211120@g44g2000cwa.googlegr oups.com...
>>> Ajay,
>>>
>>> you have chosen a binary sort-order. Since the binary value for 'T' is
>>> different from 't' the database is effectively case sensitive.
>>> Markus
>>>

>>
>>

>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-27-2008, 10:05 PM
Uri Dimant
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Hi
SELECT DATABASEPROPERTYEX('Northwind', 'Collation')





"Ajay Bansal" <ajay.bansal02@gmal.com> wrote in message
news:ujjTHSMIGHA.3036@tk2msftngp13.phx.gbl...
> Ok.. lets go back a step here..
>
> How do I know, if in a SQL serevr database - collation is binary? I mean -
> does _BIN specify that collation is binary?
>
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.co m> wrote
> in message news:eTSV2LMIGHA.3036@tk2msftngp13.phx.gbl...
>> Can you elaborate on that? Are you saying that an "English" database
>> collation which is binary doesn't make object names case sensitive? Can
>> you in that case name that exact collation name so we can test it?
>>
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>>
>> "Ajay Bansal" <ajay.bansal02@gmal.com> wrote in message
>> news:erHXzGMIGHA.1028@TK2MSFTNGP11.phx.gbl...
>>> But then, why does it work for database if collation is english?
>>>
>>> <m.bohse@quest-consultants.com> wrote in message
>>> news:1138091684.802799.211120@g44g2000cwa.googlegr oups.com...
>>>> Ajay,
>>>>
>>>> you have chosen a binary sort-order. Since the binary value for 'T' is
>>>> different from 't' the database is effectively case sensitive.
>>>> Markus
>>>>
>>>
>>>

>>

>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-27-2008, 10:05 PM
Tibor Karaszi
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Yes, BIN indicates a binary collation.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/


"Ajay Bansal" <ajay.bansal02@gmal.com> wrote in message
news:ujjTHSMIGHA.3036@tk2msftngp13.phx.gbl...
> Ok.. lets go back a step here..
>
> How do I know, if in a SQL serevr database - collation is binary? I mean - does _BIN specify that
> collation is binary?
>
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.co m> wrote in message
> news:eTSV2LMIGHA.3036@tk2msftngp13.phx.gbl...
>> Can you elaborate on that? Are you saying that an "English" database collation which is binary
>> doesn't make object names case sensitive? Can you in that case name that exact collation name so
>> we can test it?
>>
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>>
>> "Ajay Bansal" <ajay.bansal02@gmal.com> wrote in message
>> news:erHXzGMIGHA.1028@TK2MSFTNGP11.phx.gbl...
>>> But then, why does it work for database if collation is english?
>>>
>>> <m.bohse@quest-consultants.com> wrote in message
>>> news:1138091684.802799.211120@g44g2000cwa.googlegr oups.com...
>>>> Ajay,
>>>>
>>>> you have chosen a binary sort-order. Since the binary value for 'T' is
>>>> different from 't' the database is effectively case sensitive.
>>>> Markus
>>>>
>>>
>>>

>>

>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-27-2008, 10:05 PM
Erland Sommarskog
 
Posts: n/a
Default Re: SQL server becomes case sensitive if I choose collation as : Chinese_PRC_BIN

Ajay Bansal (ajay.bansal02@gmal.com) writes:
> How do I know, if in a SQL serevr database - collation is binary? I mean -
> does _BIN specify that collation is binary?


Yes. BIN = Binary. CI = Case insensitive, AI = Access insensitive,
CS = Case sensitive, AS = Accent sensitive. Some collations also has
WS and KS for Width and Kana sensitive. The latter mainly applies to
Japanese collations I believe.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:06 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com