SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Confio Ignite

Working With Nulls in SQL Server

Nulls are basic to SQL Server, but basic isn't the same as obvious. Make the mistake of typing "middlename = null" instead of "middlename is null" and no error message is thrown, the query runs, but you get the wrong answer. Nulls are an important part of database design and like any tool can be used or abused, but once you have the potential for nulls in a column, then you have to know how they work and how to make sure you get back the right answers.

Duration:
6 mins 16 secs
Skill Level:
100
Rating:
4.41 out of 5
Publish Date:
September 27, 2010
Working With Nulls in SQL Server You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
simon on 9/27/2010
Great stuff !

punjwani on 9/27/2010
Excellent presentation.

Kristeen Sellers on 9/27/2010
Interesting. However, I tend to you isnull(variablename, '') = '' rather than variablename is null. I have found that in SQL 7, the is null did not always work correctly and I still code that way for SQL 2005 & SQL 2008.

Lawrence on 9/27/2010
COALESCE(value1, value2, value3, ...) would be a nice addition to this topic.

Laura on 9/27/2010
Clear and to the point. Great Job!

Leonard Peoples on 9/27/2010
A good base will save us time. If someone's been coding in SQL for years, they may stumble on this and waist time every time this comes up. I know I've tried = NULL and <> NULL. But I won't anymore. Thanks...

Craig on 9/27/2010
Oy with the throat clearing. Edit that out please!

Alexander on 9/27/2010
very nice video

Phil on 9/27/2010
Very well organized and presented.

Keith Nessel on 9/27/2010
Great information - and reminder.

nilanaksha on 9/27/2010
Good One. Just to share, we can use = NULL in the queries if ANSI_NULLS is set to OFF.

anand on 9/28/2010
Good Video on Null basics.

Kasey Wheeler on 9/28/2010
Good Vid

Jeromy Kimani on 9/28/2010
As always great commentary from Andy.

Very good point is the different behaviour of versions like 6.5 and 2008 for people who worked with older versions.

Diana Dee on 9/30/2010
Nice and basic! I did not know that integer variables are set to 0 automatically when declared. Please watch when scrolled to the right and magnified. There was a section of video in which you had done that and the left side with code and results was cut off and not visible.

SQLSharma on 10/2/2010
Keep up the good stuff,despite non-Monday Mondays...Thanks Andy!

manik on 10/6/2010
will help handling nulls a lot.

Sandra Barnes on 10/8/2010
A lot of coughing, throat clearing for a 6 min video.

lital on 10/12/2010
Great site!!! thanks.

lital on 10/12/2010
Great site!!! thanks.

vijay on 11/10/2010
Good Demo

Bhushan on 7/10/2011
Good short video...did not know the difference between '= null', 'is null', '<> null' and 'is not null'. Still do not very much understand it; but can manage it now by executing it on a different set of data myself.



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions