SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Nulls


Nulls

Author
Message
Toreador
Toreador
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3772 Visits: 8123
da-zero (12/8/2010)
Some people are still working with earlier versions of SQL Server.


But hopefully none of them are still using ANSI_NULLS OFF or any other deprecated features?
honza.mf
honza.mf
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2519 Visits: 1323
Toreador (12/8/2010)
da-zero (12/8/2010)
Some people are still working with earlier versions of SQL Server.


But hopefully none of them are still using ANSI_NULLS OFF or any other deprecated features?

Some old applications are using ANSI_NULLS OFF.

Try to explain to users that filters of the type name not like 'honza%' don't return those lines where name is empty. They don't start with honza...



See, understand, learn, try, use efficient
© Dr.Plch
steven.malone
steven.malone
SSC-Enthusiastic
SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)

Group: General Forum Members
Points: 174 Visits: 227
Caution:
Any null values returned by subquery or expression that are compared to test_expression using IN or NOT IN return UNKNOWN. Using null values in together with IN or NOT IN can produce unexpected results

This is not in the local BOL of my work environment. And I have no control over that.

I used to try to answer QOTD based on my knowledge and research in BOL.
But questions like this are the reason I now run the code first and that takes the fun out of it.
paul s-306273
paul s-306273
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3423 Visits: 1162
Nice question!
tommyh
tommyh
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2482 Visits: 2000
steven.malone (12/8/2010)
Caution:
Any null values returned by subquery or expression that are compared to test_expression using IN or NOT IN return UNKNOWN. Using null values in together with IN or NOT IN can produce unexpected results

This is not in the local BOL of my work environment. And I have no control over that.

I used to try to answer QOTD based on my knowledge and research in BOL.
But questions like this are the reason I now run the code first and that takes the fun out of it.


This logic i dont get at all. The question is great for showing a "gotcha" in SQL. If it isnt in your BOL... then even better. You just learned something that you dont know and couldnt have found out any other way (since its not in your BOL). The QOTD isnt there for us to score points... its there to teach/spread knowledge. Sometimes its not so good... but then the discussion is normally better. So either way... goal accieved. The points are just a bonus... if you get it right.

Seriously whats the point of running the code... getting your point and then moving along?

/T
honza.mf
honza.mf
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2519 Visits: 1323
tommyh (12/8/2010)
The QOTD isnt there for us to score points...

It's easy to say this if you have one thousand points :-D



See, understand, learn, try, use efficient
© Dr.Plch
ronmoses
ronmoses
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1660 Visits: 1011
tommyh (12/8/2010)
The QOTD isnt there for us to score points... its there to teach/spread knowledge.

Exactly. I knew I was answering the question incorrectly -- it was the result I would have expected, which is never the right answer in QotDs -- but I went with that answer anyway because I wanted to learn something. I have no idea how many "points" I have, nor do I care, nor do I know what I would do with that information if I had it.

[edit: Okay, now I see how many points I have. And then what, can I trade them in for prizes like skee-ball tickets or something?]

Ron

-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown

tommyh
tommyh
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2482 Visits: 2000
honza.mf (12/8/2010)
tommyh (12/8/2010)
The QOTD isnt there for us to score points...

It's easy to say this if you have one thousand points :-D


Those points also go up from posting. So in theory i could have answered ALL QOTD wrong and have 1000... 1001 forum posts... so doesnt say that much.

/T
tommyh
tommyh
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2482 Visits: 2000
ronmoses (12/8/2010)
tommyh (12/8/2010)
The QOTD isnt there for us to score points... its there to teach/spread knowledge.

Exactly. I knew I was answering the question incorrectly -- it was the result I would have expected, which is never the right answer in QotDs -- but I went with that answer anyway because I wanted to learn something. I have no idea how many "points" I have, nor do I care, nor do I know what I would do with that information if I had it.

[edit: Okay, now I see how many points I have. And then what, can I trade them in for prizes like skee-ball tickets or something?]

Ron


No you can only compare it to others like Jeff Moden and GilaMonster... and cry :-P

/T
honza.mf
honza.mf
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2519 Visits: 1323
tommyh (12/8/2010)
honza.mf (12/8/2010)
tommyh (12/8/2010)
The QOTD isnt there for us to score points...

It's easy to say this if you have one thousand points :-D


Those points also go up from posting. So in theory i could have answered ALL QOTD wrong and have 1000... 1001 forum posts... so doesnt say that much.

/T

Yessir. And I now obtain one more point! w00t
Sorry, I have a bad day (or maybe a week) and this to relax a little.



See, understand, learn, try, use efficient
© Dr.Plch
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search