What's the point of “NOT NULL DEFAULT '' ”?

后端 未结 7 843
时光说笑
时光说笑 2021-02-01 05:10

I\'ve seen this on a lot of fields on a DB from a project I\'ve been working on, where a column will be defined not null, but will have an empty string as the default. what\'s t

7条回答
  •  情歌与酒
    2021-02-01 06:02

    We do not allow nulls because programmatically accessing a field from a datatable with a DBnull value causes an exception, while an empty string has a value and therefore does not error.

提交回复
热议问题