storing a Default Value in a Table
How to store a
Default Value in a table using sqlserver?
there are 3 columns name, location and gender in a table called ‘default_tbl’.
am going to insert record in a default_tbl.
above output you can see I given only name and location values. I don’t want to
make a gender column as null. if the user forgets to give the value of gender, by default you have to store
the value as MALE.
have to set the default value of gender column. Open your Design Table, Select
the gender column. In Properties Enter ’ Male‘ under Default Value.
the below image how to set the default value:
Now I am
going to insert records without giving a gender values. You can observer the
output result in below image: