If it's not a nullable column, you have to insert some value to existing table in SQL server.
To add a column in a table, use the following syntax:
ALTER TABLE table_name
ADD column_name datatype NULL DEFAULT default_value WITH VALUES
Keep in mind that if the column is nullable, then null will be the value used for existing rows.If it's not a nullable column, you have to insert some value of that data type. So, for existing records, new value will be inserted in them.
ALTER TABLE tbl_employee
ADD FAX varchar(50) NULL DEFAULT 'NOT AVAILABLE' WITH VALUES
Post your comments / questions
Recent Article
- How to create custom 404 error page in Django?
- Requested setting INSTALLED_APPS, but settings are not configured. You must either define..
- ValueError:All arrays must be of the same length - Python
- Check hostname requires server hostname - SOLVED
- How to restrict access to the page Access only for logged user in Django
- Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
Related Article