database - MS Access - sql expression for allow null? -
i use ms access (2003) database. once create column set not null using sql statement:
alter table table1 alter column mycolumn integer not null
is there way change allow null values? tried:
alter table table1 alter column mycolumn integer null
but nothing...
you cant specify null
in alter table
(although not null
allowed)
see below documentation , discussion on toppic
syntax
alter table table {add {column field type[(size)] [not null] [constraint index] | alter column field type[(size)] | constraint multifieldindex} | drop {column field constraint indexname} }
old school solution:-
- create new temporray field null same datatype
- update new temporary field existing not null field
- drop old not null field
- create droped column same datatype again without not null
- update existing field temporary field
- if there have been indices on existing field, recreate these
- drop temporary field
Comments
Post a Comment