515 SQL Origin: Data OSI layer 7 · Application Last updated 18 Nov 2026

SQL Server Msg 515: Cannot insert the value NULL into column 'X', table 'Y'; column does not allow nulls

An INSERT or UPDATE tried to put NULL into a NOT NULL column that has no default.

Exact message you may see Cannot insert the value NULL into columncolumn does not allow nulls. INSERT failsCannot insert the value NULL into column 'Name', table 'dbo.Users'SqlException 515
Seen on: SQL Server SQL

Meaning

Provide a value, add a default constraint, or make the column nullable if NULL is valid. Check the INSERT column list (a missing column becomes NULL), triggers and the application mapping.

Common causes

  • Column omitted from the INSERT list
  • App passing null
  • No DEFAULT on a NOT NULL column
  • JOIN-based INSERT producing NULLs
  • Trigger or ORM mapping gap

⚡ Quick fix

  1. Supply the value or add DEFAULT
  2. Make the column nullable if appropriate
  3. Check the generated INSERT statement

Detailed fix by platform

SQL

  1. ALTER TABLE dbo.Users ADD CONSTRAINT DF_Users_Status DEFAULT 'active' FOR Status;

How to diagnose

  1. Column — NOT NULL?
  2. Default — Defined?
  3. INSERT — Includes the column?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

= NULL — WHERE col = NULL returns no rows (use IS NULL) (SQL)= NULL10054 — SQL Server error 10054: An existing connection was forcibly closed by the remote host (SQL)100541022 — MySQL ERROR 1022 (23000): Can't write; duplicate key in table (MySQL)10221048 — MySQL ERROR 1048 (23000): Column 'x' cannot be null (MySQL)1048105 — SQL Server Msg 105: Unclosed quotation mark after the character string (SQL)1051062 — MySQL ERROR 1062 (23000): Duplicate entry for key (MySQL)10621105 — SQL Server Error 1105: Could not allocate space for object in database because the PRIMARY filegroup is full (SQL)11051451 — MySQL ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (MySQL)1451515

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.