• Matt Miller (5/13/2008)


    GSquared (5/13/2008)


    I just checked my databases and servers, and ANSI padding is False on all of them, but per BOL:

    Important:

    In a future version of SQL Server ANSI_PADDING will always be ON and any applications that explicitly set the option to OFF will produce an error. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

    I've never messed with the setting, I assumed it was True because of what it says in BOL, but it looks like BOL might be wrong about the default.

    That ON sets up some REALLY interesting things. Things that go to challenging my recollection of various fundamental math principles. For example - (taking the wayback machine all of the way back to 6th grade as I recall):

    If it is true that x=y and a=b, then so is x+a=y+b

    Therefore we should be to say...

    'a '='a'

    and

    'b '='b'

    then

    'a '+'b '='a'+'b' :crazy:

    ...

    I feel a tear in the space/time continuum....:P

    Too bad concatenation isn't math. 🙂

    2+6 = 8

    6+2 = 8

    so

    6+2 = 2+6

    but

    '2'+'6' = '26'

    and

    '6'+'2' = '62'

    so

    '2'+'6' != '6'+'2'

    But yeah, it does make for some weird things we have to keep track of in our code that don't necessarily make intuitive sense to everyone. (But then, intuition is subjective, just like common sense.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon