Insert Empty Strings as NULL

Posts   
 
    
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 05-Mar-2012 04:05:17   

For entities with nullable fields is there a setting in the designer that sets empty string values to null when inserting the record to the database.

When creating a new entity and saving it if I do not set the value of a nullable property the value is an empty string in the database. I want it to be null by default.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 05-Mar-2012 09:28:00   

If you don't set a field, nothing would be generated for it in the INSERT command. In that case, Null should be saved in the database, unless you have a default value set in the database.