MySQL Forums :: Database Design & Data Modelling :: Should I add a default value for a field that is set to NOT NULL


Advanced Search

Should I add a default value for a field that is set to NOT NULL
Posted by: b p ()
Date: July 15, 2009 01:50PM

Hopefully this is a quick question:

I have a table that has an INT column that does not allow nulls, Should I still enter a default value for the column such as '0'?

It would seem that I would not need to because the record would not add if there is no value, but i wanted to make sure that there wasnt something i was missing.

thanks.

Options: ReplyQuote


Subject Written By Posted
Should I add a default value for a field that is set to NOT NULL b p 07/15/2009 01:50PM
Re: Should I add a default value for a field that is set to NOT NULL Rick James 07/16/2009 07:49PM
Re: Should I add a default value for a field that is set to NOT NULL b p 07/17/2009 08:10AM
Re: Should I add a default value for a field that is set to NOT NULL Rick James 07/17/2009 07:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.