dbTalk Databases Forums  

SQL2005 collation vs Oracle

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss SQL2005 collation vs Oracle in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-12-2006 , 05:24 PM






Alexander Kuznetsov (AK_TIREDOFSPAM (AT) hotmail (DOT) COM) writes:
Quote:
on one hand, I would concur: in most cases we need case insensitive
data in the database. For instance, we in our shop uppercase all the
data when we load it into Oracle. On the other hand, I think that case
sensitive indexes may be implemented more efficiently than case
insensitive ones, just because binary (case sensitive) comparisons are
the fastest ones possible. However I am not sure what the performance
gain might be...
Note that binary <> case-sensitive in SQL Server. That is, a binary
collation is case-sensitive, however the reverse does not apply. My
standard collation is Finnish_Swedish_CS_AS, and it's binary. It co-
sorts V and W, Y and Ü.and sorts ÅÄÖ in the right order.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) 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


Reply With Quote
  #22  
Old   
DA Morgan
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-12-2006 , 06:11 PM






Alexander Kuznetsov wrote:
Quote:
Daniel,

you failed to notice a loud and clear ORDER BY clause in my script

SELECT * FROM T1 order by c1;

and decided I'm a newbie and need a lecture on the basics?

Not sure I saw the original script. But I did see a statement
indicating different behaviour between Oracle and SQL Server.
With an ORDER BY the result set is identical.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #23  
Old   
Alexander Kuznetsov
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-12-2006 , 10:38 PM



Quote:
With an ORDER BY the result > set is identical.
Can you post versions of SQL Server and Oracle and operating systems
for which they are identical?

In fact it is a well known little obstacle in migrations between
Oracle and SQL Server. More to the point, immediately before posting I
ran the script and cut and pasted my results. Repeat, the results as
harvested from 2 live servers several hours ago are different:

SELECT * FROM T1 order by c1;

SQL Server:

c1
----------
A_A
AAA

(2 row(s) affected)

drop table t1;

The same script in Oracle running on UNIX (HP-UX) returns rows in a
different
order:

C1
----------
AAA
A_A



Reply With Quote
  #24  
Old   
Alexander Kuznetsov
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-13-2006 , 01:00 PM



Quote:
Note that binary <> case-sensitive in SQL Server.
yes, but you need < and > comparisons to navigate an index. I guess
Finnish_Swedish_CS_AS collation is implemened as a function. As such,
it probably works a little bit slower than raw bytes comparison,
probably no big deal, just a little bit slower. Makes sence?



Reply With Quote
  #25  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-13-2006 , 02:10 PM



Alexander Kuznetsov (AK_TIREDOFSPAM (AT) hotmail (DOT) COM) writes:
Quote:
Note that binary <> case-sensitive in SQL Server.

yes, but you need < and > comparisons to navigate an index. I guess
Finnish_Swedish_CS_AS collation is implemened as a function. As such,
it probably works a little bit slower than raw bytes comparison,
probably no big deal, just a little bit slower. Makes sence?
Exactly how Finnish_Swedish_CS_AS is implemented I don't know, but
I don't think the difference is smaller with regards to Finnish_Swedish_BIN
than to Finnish_Swedish_CI_AI.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) 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


Reply With Quote
  #26  
Old   
Nasir
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-15-2006 , 10:13 AM



Thank you all for your commencts on this - I didn't know it is so common and
relatively painful issue. Certainly, I wasn't expecting it, that ther eis no
easy solution to this.

My opinion is that table and column name should be insensitive by pretty
much 80/20 or yet better 99/1 rule (it's a new one:-), the 1 only when we
are looking for readability of the object or column name. To the contrary,
we always need to read the data (actual information) from these tables and
columns, so data got to be sensitive. I don't think people enjoy seeing
there names in funny cases like mIKe vs Mike, let alone that e.e...example
which I'm not aware of.

More importatntly, if it is such a pain then why not provide this as an
option in collation; if SQL server can give you so many other options, this
one can also be included - specially when SQL server is not the leader in DB
category.

I think adopting a standard is good - so I'll be forced to use
SQL_Latin1_General_CP1_CS_AS to keep all sensitive across the board to avoid
confusions.

chao,
Nasir




"Alexander Kuznetsov" <AK_TIREDOFSPAM (AT) hotmail (DOT) COM> wrote

Quote:
With an ORDER BY the result > set is identical.

Can you post versions of SQL Server and Oracle and operating systems
for which they are identical?

In fact it is a well known little obstacle in migrations between
Oracle and SQL Server. More to the point, immediately before posting I
ran the script and cut and pasted my results. Repeat, the results as
harvested from 2 live servers several hours ago are different:

SELECT * FROM T1 order by c1;

SQL Server:

c1
----------
A_A
AAA

(2 row(s) affected)

drop table t1;

The same script in Oracle running on UNIX (HP-UX) returns rows in a
different
order:

C1
----------
AAA
A_A




Reply With Quote
  #27  
Old   
Tony Rogerson
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-15-2006 , 03:39 PM



I think Nasir you've already been told several times how you can do this
with SQL Server.

I don't see a problem setting the database collation to case insensitive and
specifying at a column level the case sensitive option - you need only do it
once at CREATE TABLE time and its no more hassle then writing NOT NULL or
NULL, its COLLATE <collation name>.

I'd suggest you think this through a lot more, consider the problems with
data being case sensitive.

When you type in 'sql server' into google does it only bring back those
results that had 'sql server' in them or do they bring back the 'SQL Server'
ones too, or perhaps Oracle users have some mystical power that allows them
to sense correct case and type it correctly every time....

There is no benefit to case sensitivity unless you are enforcing it in the
real world and to my experience (19+ years of development) there are seldom
cases for case sensitive data.

Tony.

--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials


"Nasir" <nmajeed (AT) prosrm (DOT) com> wrote

Quote:
Thank you all for your commencts on this - I didn't know it is so common
and relatively painful issue. Certainly, I wasn't expecting it, that ther
eis no easy solution to this.

My opinion is that table and column name should be insensitive by pretty
much 80/20 or yet better 99/1 rule (it's a new one:-), the 1 only when we
are looking for readability of the object or column name. To the contrary,
we always need to read the data (actual information) from these tables and
columns, so data got to be sensitive. I don't think people enjoy seeing
there names in funny cases like mIKe vs Mike, let alone that e.e...example
which I'm not aware of.

More importatntly, if it is such a pain then why not provide this as an
option in collation; if SQL server can give you so many other options,
this one can also be included - specially when SQL server is not the
leader in DB category.

I think adopting a standard is good - so I'll be forced to use
SQL_Latin1_General_CP1_CS_AS to keep all sensitive across the board to
avoid confusions.

chao,
Nasir




"Alexander Kuznetsov" <AK_TIREDOFSPAM (AT) hotmail (DOT) COM> wrote in message
news:1147491491.272900.168260 (AT) y43g2000cwc (DOT) googlegroups.com...
With an ORDER BY the result > set is identical.

Can you post versions of SQL Server and Oracle and operating systems
for which they are identical?

In fact it is a well known little obstacle in migrations between
Oracle and SQL Server. More to the point, immediately before posting I
ran the script and cut and pasted my results. Repeat, the results as
harvested from 2 live servers several hours ago are different:

SELECT * FROM T1 order by c1;

SQL Server:

c1
----------
A_A
AAA

(2 row(s) affected)

drop table t1;

The same script in Oracle running on UNIX (HP-UX) returns rows in a
different
order:

C1
----------
AAA
A_A






Reply With Quote
  #28  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL2005 collation vs Oracle - 05-15-2006 , 04:41 PM



Tony Rogerson (tonyrogerson (AT) sqlserverfaq (DOT) com) writes:
Quote:
I don't see a problem setting the database collation to case insensitive
and specifying at a column level the case sensitive option - you need
only do it once at CREATE TABLE time and its no more hassle then writing
NOT NULL or NULL, its COLLATE <collation name>.
Depends on how many tables you have. :-)

And you would have to set the server collation to be case-sensitive,
or else temp tables will be painful.




--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) 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


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.