views:

1448

answers:

2

How to Set a existing column of MS SQL table as NOT NULL?

+8  A: 
ALTER TABLE tablename
ALTER COLUMN columnname datatype NOT NULL

You will obviously have to make sure that the column does not contain any NULL values before doing this.

AdamRalph
+1  A: 

You might also want to add a default contraint to the column.

Charles Graham