Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Alter Table [!]TableName[/!] Alter Column [!]ColumnName[/!] [!]DataType[/!] Not NULL
Ex:
Alter Table People Alter Column EyeColor VarChar(10) Not Null
create table bla666(id int,col2 int)
go
--change column to be not null
alter table bla666 alter column id int not null
--try inserting a null value
insert into bla666 values(null,1)
--error
Server: Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'id', table 'Blog.dbo.bla666'; column does not allow nulls. INSERT fails.
The statement has been terminated.
That's not true. It's right in the snippet you posted. Immediately after "ALTER COLUMN column_name" is a curly brace. Curly braces mean, "all the elements within are required unless in square brackets."There is NO mention of needing to put the data type in here