ADDing COLUMN to the table with exising data with DEFAULT value and NOT NULL constraint

  • Thread starter Thread starter Vyacheslav Lanovets
  • Start date Start date
V

Vyacheslav Lanovets

What happens with exisiting rows in the Access table when I add a column
with NOT NULL constraint and some DEFAULT value?

Why the column is NOT populated with that DEFAULT value for existing rows??
(Neither through ADO nor through Access table designer).

Regards, Vyacheslav
 
Default Value applies only to existing records.
It has no bearing on existing records.

To alter your existing records:
1. Create a query into this table.

2. Drage the field into the grid.

3. In the Criteria row, enter:
Is Null

4. After verifying these are the desired records, change the query to an
Update query (Update on Query menu). Access adds an Update row to the grid.

5. In the Update row, type the value you wish to assign to the existing
records.

6. Run the query.
 
Back
Top