Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««12345»»

IFF - 1 Expand / Collapse
Author
Message
Posted Friday, June 7, 2013 9:16 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, July 7, 2014 8:58 AM
Points: 643, Visits: 400
WWDMark (6/6/2013)
I was wondering about the collation issue (i.e. case sensitive or not) and as the question didn't specify the collation I took a punt...... and got it wrong! Hey Ho.

+1
Post #1461131
Posted Friday, June 7, 2013 2:26 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 8, 2014 7:22 AM
Points: 3, Visits: 67
why does 'r ' = 'R'

this is like saying Length or 2 = Length of 1

in the problem it is small r + a blank space set = capitol R

Length of the left side is 2 <> Length of the right side of 1

therefore it should answer no

not yes

why is this not true?
Post #1461218
Posted Friday, June 7, 2013 2:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 8, 2014 7:22 AM
Points: 3, Visits: 67
why does 'r ' = 'R'

this is like saying Length or 2 = Length of 1

in the problem it is small r + a blank space set = capitol R

Length of the left side is 2 <> Length of the right side of 1

therefore it should answer no

not yes

why is this not true?
Post #1461221
Posted Friday, June 7, 2013 2:34 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:22 PM
Points: 5,925, Visits: 8,174
eric larocca (6/7/2013)
why does 'r ' = 'R'

this is like saying Length or 2 = Length of 1

in the problem it is small r + a blank space set = capitol R

Length of the left side is 2 <> Length of the right side of 1

therefore it should answer no

not yes

why is this not true?

Please read the posts already made, as they answer this question. If anything is unclear after reading the existing discussion, feel free to ask.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1461223
Posted Tuesday, June 11, 2013 1:45 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, July 25, 2014 12:44 PM
Points: 769, Visits: 1,161
Hugo Kornelis (6/6/2013)
Joseph M. Morgan (6/6/2013)
The first string has a space after the letter, the second does not. Without a Trim, why are they equal? Case sensitivity is irrelevant. The two strings aren't equal.

Trailing blanks are trimmed before string comparison. This is documented in Books Online.

What I am wondering, though, is why the question explicitly introduces both lowercase and uppercase. I now had to take a 50% gamble as to the default collation used by the author's server. Why not either use the same case for both, or explicitly specify the collation?



+1
Post #1462358
Posted Thursday, June 13, 2013 5:08 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 8:03 AM
Points: 825, Visits: 319
L' Eomot Inversé (6/6/2013)
michlimes (6/6/2013)
default collation is choosen at installation process - so imo it could be CS_AS.

You can override the installation defaults when doing the installation. Then you don't have a default installation any more, you have a non-default one. So the word "default" is a bit ambiguous - the server default in your instance is not the installation default.

However, I think you are right to suggest that the collation should always be specified in a QotD when it is relevant.


I think I've seen in the discussions of previous questions that where something isn't specified it's reasonable to assume the system has been set up with installation defaults. That's the way I read this and, from a previous QotD, I know the installation default is case insensitive so I got this right.

However, there are an awful lot of installation defaults that I don't know so I agree it would useful to have anything that applies to a QotD to be stated positively at the start.
Post #1462983
Posted Tuesday, June 18, 2013 2:37 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 11:08 PM
Points: 21,231, Visits: 14,940
Thanks for the question Ron.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1464879
Posted Wednesday, June 19, 2013 1:38 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, July 21, 2014 6:24 AM
Points: 3,537, Visits: 2,647
I was wondering why so many questions regarding the collation. In a normal scenario it should be considered as the default behaviour for the question which is CI (and not CS). I feel it was a great example of simple QOTD.
Post #1464976
Posted Wednesday, June 19, 2013 2:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:22 PM
Points: 5,925, Visits: 8,174
sqlnaive (6/19/2013)
In a normal scenario it should be considered as the default behaviour for the question which is CI (and not CS).

I disagree, and I'll tell you why.

In questions where collation is not a factor, using the consistent case throughout the question prevents ambiguity. If you ensure the question works okay onm a CS collation, it will also be okay on a CI collation. The reverse is not true. So writing the question for a CS collation is the best way to ensure that everyone has a fair chacne - including those who are aware that not all SQL Server instances in the world are installed on a CI collation.

And in questions where collation is a factor, the collation should always be included in the question, so there can never be a problem there.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1464982
Posted Wednesday, June 19, 2013 4:06 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, July 21, 2014 6:24 AM
Points: 3,537, Visits: 2,647
Agreed Hugo. That should be the case ideally. However probably I was not clear. What i wanted to say here was that the emphasis should be given based on the question's subject. As in this scenario the question was for IFF category in SQL 2012 environment. The different cases of value ('r' or 'R') may raise doubt in mind but in such case obviously we should go with default settings. Maybe I'm thinking too liberal on this.
Post #1465040
« Prev Topic | Next Topic »

Add to briefcase «««12345»»

Permissions Expand / Collapse