SQL Server: ALTERTABLEPersons ADDCONSTRAINTdf_City DEFAULT'Sandnes'FOR City; MS Access: ALTERTABLEPersons ALTERCOLUMNCitySETDEFAULT'Sandnes'; Oracle: ALTERTABLEPersons MODIFYCityDEFAULT'Sandnes'; DROP a DEFAULT Constraint To drop aDEFAULTconstraint, use the following SQL: ...
The DEFAULT constraint is used to set a default value for a column.The default value will be added to all new records, if no other value is specified.DEFAULT on CREATE TABLEThe following SQL sets a DEFAULT value for the "City" column when the "Persons" table is created:...
SQL Server: ALTERTABLEPersons ADDCONSTRAINTdf_City DEFAULT'Sandnes'FOR City; MS Access: ALTERTABLEPersons ALTERCOLUMNCitySETDEFAULT'Sandnes'; Oracle: ALTERTABLEPersons MODIFYCityDEFAULT'Sandnes'; DROP a DEFAULT Constraint To drop a DEFAULT constraint, use the following SQL: ...