In Microsoft SQL Server, I want to alter a field to “NOT NULL” AND DEFAULT ”.
I’ve already issued the following two commands:
ALTER TABLE USR ADD Country Varchar(128)
UPDATE USR SET Country=''
Now I need
1. ALTER TABLE USR ADD CONSTRAINT CountryIsNotNull something
2. ALTER TABLE USR ADD CONSTRAINT CountryDefault default ''
You should be able to google it however here is the syntax:
You could have done the whole thing in one line though with the following: