Internet, Networking, & Security Web Development NOT NULL Constraints in Microsoft SQL Server Ensure that the proper amount of data has been entered By Mike Chapple Writer Former Lifewire writer Mike Chapple is an IT professional with more than 10 years' experience cybersecurity and extensive knowledge of SQL and database management. our editorial process Twitter Mike Chapple Updated April 09, 2020 slungu / Getty Images Web Development SQL CSS & HTML Web Design Tweet Share Email NOT NULL constraints in Microsoft SQL Server specify that a column may not contain NULL values. Null is different from a zero or a zero-character string. Null means that no entry has been made. When you create a new NOT NULL constraint on a database column, SQL Server checks the column’s current contents for any NULL values. If the column currently contains NULL values, the constraint creation fails. Otherwise, SQL Server adds the NOT NULL constraint. All future INSERT or UPDATE commands that would cause the existence of a NULL value will fail to commit the transaction. Creating a NOT NULL Constraint There are many ways you can create a UNIQUE constraint in SQL Server. If you wish to use Transact-SQL to add a UNIQUE constraint on an existing table, you may use the ALTER TABLE statement, as illustrated below: ALTER TABLEALTER COLUMN NOT NULL If you prefer to interact with SQL Server using GUI tools, you may also create a NOT NULL constraint using SQL Server Management Studio. Here’s how: Open SQL Server Management Studio.Expand the Tables folder of the database where you wish to create the constraint.Right-click the table where you wish to add the constraint and click Design.Check the NOT NULL checkbox for the column(s) that you wish to have NOT NULL constraint(s).