.NET: Allow NULLS in DB fields?
Posted
by mark smith
on Stack Overflow
See other posts from Stack Overflow
or by mark smith
Published on 2010-04-14T09:35:50Z
Indexed on
2010/04/14
9:43 UTC
Read the original article
Hit count: 356
Hi there,
I have the task of re-factoring an SQLServer DB.... A lot of the tables and columns "ALLOW NULLS", Is this good practice...
I seem to remember the authour of CSLA.NET saying it was really bad practice to allow nulls in a DB...
If this is the case, what are my alternatives?
Remove all "ALLOW NULLS" from all columns.... and in numeric columns use a value of -1 for example??
I would really appreciate any input anyone has.
I am currently using a Model (from entity framework) from my DB and the db columns that "ALLOW NULLS" are null ... and some of the stored procedures require that i have a default value... i.e. BOOLEAN require FALSE as default ... but it is null..
Well i don't want to stray from my original question, ALLOW NULLS are a bad thing from what i can gather .... so how do i fix this ?
Any help really appreciated
© Stack Overflow or respective owner