• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

SQL Server collations

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    SQL Server collations

    ... with case insensitivity being default for strings...










    #2
    are you mad because the collation is case insensitive?
    Thats considered normal practice
    Coffee's for closers

    Comment


      #3
      Originally posted by Spacecadet View Post
      are you mad because the collation is case insensitive?
      Yes.

      I should have paid more attention to default collations - using case insensitive is nuts.

      Comment


        #4
        Originally posted by AtW View Post
        Yes.
        using case insensitive is nuts.
        Why? I just think case sensitivity is a pain in anything 'pooter related. Never performed a development or database task that benefitted from it.

        Only reason i can think of is if you are deploying it somewhere else that IS case sensitive. Having something where ID, Id and id are different things is just horrible.
        Last edited by Durbs; 2 February 2010, 21:44.

        Comment


          #5
          Ugh, Latin1_general_bin is the bane of my part time work at the moment!

          Why would anyone want A to come after b!

          If you need it for one particular field use the collate clause ie select textfield1 collate latin1_general_bin from blah

          Why doom the whole database to be bin!

          I doubt you'd have much of a case for performance gains these days either so don't try that one.

          Comment


            #6
            If you don't want case sensitive query you can use lower() or (if you are concerned about performance) lower case data before inserting it into database, or have another lower cased field if you need both.



            Anyway bug is fixed and lesson learnt: I was going to yank SQL Server out of the window soon, and now that's going to happen a lot sooner

            Comment


              #7
              Originally posted by AtW View Post
              Yes.

              I should have paid more attention to default collations - using case insensitive is nuts.
              Why do you want case sensitivity?

              In EVERY system I've worked on having a case sensitive database would have been a nightmare
              Coffee's for closers

              Comment


                #8
                Originally posted by Spacecadet View Post
                Why do you want case sensitivity?
                Data is case sensitive - we were storing URLs that were checked to be unique for given report before insertion, this was causing issues due to case insensitive nature of default collation. Solved now, but a bit annoyed - defaults in my view should not have such sneaky side effects: this effectively forces to use explicit collation in SQL, leading to dirty code.

                Originally posted by Spacecadet View Post
                In EVERY system I've worked on having a case sensitive database would have been a nightmare
                Then you are not Spartacus!

                Comment


                  #9
                  Originally posted by AtW View Post
                  defaults in my view should not have such sneaky side effects: this effectively forces to use explicit collation in SQL, leading to dirty code.
                  Change the view to specify collation then

                  Default collation is set at instance level and can easily be determined during install.
                  If it's that important then fire your DBA and get someone who knows what they're doing in!
                  Coffee's for closers

                  Comment


                    #10
                    Originally posted by Spacecadet View Post
                    Default collation is set at instance level and can easily be determined during install.
                    Could not change it on database level even on my small test DB, decided to walk away from that risk and just used COLLATE in SQL, this part of the SKA is definately going out of relational DB, out out out ...

                    I'd gladly follow your advice and fire our DBA but that would be like firing myself...

                    Comment

                    Working...
                    X