You are here: Re: SQL2005 collation vs Oracle « MsSQL Server « IT news, forums, messages
Re: SQL2005 collation vs Oracle

Posted by Nasir on 10/02/95 11:47

David,

I installed 2005 server with SQL_Latin1_General_CP1_CS_AS in hope to
acheive what you described, but look what happens:

3> create table t1 (c1 char(10))
4> go
2> NSERT INTO t1 VALUES('mike')
3> go
(1 rows affected)
1> INSERT INTO t1 VALUES('mike')
2> go
(1 rows affected)

1> SELECT * FROM T1 WHERE c1='Mike'
2> go
Msg 208, Level 16, State 1, Invalid object name 'T1'.
1>
2> SELECT * FROM t1 WHERE c1='Mike'
3> go
c1
----------
Mike

(1 rows affected)
1>

I wonder if collation you mentioned Latin1_General_CS_AS is available at
server level?

Thanks,
Nasir


"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message
news:1147377053.596753.143460@q12g2000cwa.googlegroups.com...
> Nasir wrote:
>> Hi there,
>>
>> Is it posible to set the collation of SQL server 2005 like Oracle, which
>> is
>> that objects names and column names are case-insensitive, but data is
>> sensitive;e.g:
>>
>> In Oracle:
>> --create lower-case table and column name
>> create table t1(c1 char(10));
>> --Mike with upper-case J
>> insert into t1 values('Mike');
>> --follwoing I'm changing case in the table name, but it works, however
>> 'Mike' has to be with uppewr case M
>> select * from T1 where c1='Mike'
>>
>> Above test fails in SQL server. Is there a collation which can make data
>> 'literals' sensitive, but data dictionary or the object names and column
>> names case insensitive?
>>
>> TIA,
>> Nasir
>
> Yes. In fact the collation for data is always determined at column
> level. The database collation defines whether identifiers are
> case-sensitive and is also the default for the column collation. Take a
> look at the collations topics in Books Online.
>
> CREATE TABLE t1(c1 CHAR(10) COLLATE Latin1_General_CS_AS NOT NULL /*
> ... */);
> INSERT INTO t1 VALUES('Mike');
> INSERT INTO t1 VALUES('mike');
>
> SELECT * FROM T1 WHERE c1='Mike';
>
> Result:
>
> c1
> ----------
> Mike
>
> (1 row(s) affected)
>
> --
> David Portas, SQL Server MVP
>
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
>
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация