Author Topic: Very General Question: Purpose of NULL  (Read 465 times)

0 Members and 1 Guest are viewing this topic.

Offline exit44Topic starter

  • Irregular
  • Posts: 4
    • View Profile
Very General Question: Purpose of NULL
« on: March 15, 2010, 01:04:44 PM »
I have a very general question about database design.  What is the purpose of allowing a field to be set to a NULL value in a database field.  I have been building for a while and have really never used this setting.  I always just test the output before displaying to the browser and if the field is empty I treat it accordingly.  What are the advantages of NULL over this or does it have other purposes?

Thanks!

Offline aeroswat

  • Devotee
  • Posts: 848
    • View Profile
Re: Very General Question: Purpose of NULL
« Reply #1 on: March 15, 2010, 02:05:05 PM »
Maybe this will be helpful to you

http://www.informit.com/guides/content.aspx?g=sqlserver&seqNum=215

I have also recently found a great use for NULL values. I required the ability to find all the rows in one table that could not relate to a row in another table based on the joining key. The only way to display these were to display only rows in which the joining key was NULL.

Offline exit44Topic starter

  • Irregular
  • Posts: 4
    • View Profile
Re: Very General Question: Purpose of NULL
« Reply #2 on: March 15, 2010, 02:36:51 PM »
Very helpful article.  Thank you for posting it for me.