How to remove not null constraint in sql server using query
Sql ServerSqlSql Server Problem Overview
I am trying to remove not null constraint in sql server 2008 without losing data.
Sql Server Solutions
Solution 1 - Sql Server
ALTER TABLE YourTable ALTER COLUMN YourColumn columnType NULL
Solution 2 - Sql Server
Remove constraint not null
to null
ALTER TABLE 'test' CHANGE COLUMN 'testColumn' 'testColumn' datatype NULL;
Solution 3 - Sql Server
Remove column constraint: not null
to null
ALTER TABLE test ALTER COLUMN column_01 DROP NOT NULL;
Solution 4 - Sql Server
ALTER TABLE tableName MODIFY columnName columnType NULL;