Sql – Modify table: How to change ‘Allow Nulls’ attribute from not null to allow null

sqlsql serversql-server-2008

How to change one attribute in a table using T-SQL to allow nulls (not null –> null)? Alter table maybe?

Best Answer

-- replace NVARCHAR(42) with the actual type of your column
ALTER TABLE your_table
ALTER COLUMN your_column NVARCHAR(42) NULL