Home Forums SQL Server 7,2000 T-SQL Alter Column - Add Not Null RE: Alter Column - Add Not Null
ramses2nd
Hall of Fame
Points: 3720
More actions
February 7, 2006 at 5:51 am
#619217
To Add a default constraint of 0 and then change the filed to NOT NULL I would use the following:
ALTER TABLE DATA ADD CONSTRAINT
DF_DATA_istested DEFAULT 0 FOR istested
GO
ALTER TABLE DATA
ALTER COLUMN [IsTested] [bit] NULL