Null column entries

S

SteveJ

According to MS's SQL documentation, the following applies:


Column definition No entry,
no DEFAULT definition No entry,
DEFAULT definition Enter a null value
Allows null values NULL Default value NULL
Disallows null values Error Default value Error


I have a nvarchar column for which I have set a default value of '' i.e.
zero length string.

New records are not problem, changed ones are:

If data is entered this is stored OK. The problem occurs when the record is
revisited and the user decides to remove all the data. When the column data
is committed, the error "Non-nullable column cannot be updated to Null"
occurs.

According to MS's description above, I would expect the default value to be
entered i.e. zero length string.

Anyone got any words of wisdom on this?
 
B

Bruce Loving

Default values only apply to adding new records.
So if a user tries to delete all the data in a
record, the Null is necessary or you get this
message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top