(NOT) NULL for NVARCHAR columns
Posted
by Anders Abel
on Stack Overflow
See other posts from Stack Overflow
or by Anders Abel
Published on 2010-06-10T08:45:54Z
Indexed on
2010/06/10
9:03 UTC
Read the original article
Hit count: 235
sql
Allowing NULL
values on a column is normally done to allow the absense of a value to be represented. When using NVARCHAR
there is aldready a possibility to have an empty string, without setting the column to NULL
. In most cases I cannot see a semantical difference between an NVARCHAR
with an empty string and a NULL
value for such a column.
Setting the column as NOT NULL
saves me from having to deal with the possibility of NULL
values in the code and it feels better to not have to different representations of "no value" (NULL
or an empty string).
Will I run into any other problems by setting my NVARCHAR
columns to NOT NULL
. Performance? Storage size? Anything I've overlooked on the usage of the values in the client code?
© Stack Overflow or respective owner