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.
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 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
- Supply the value or add
DEFAULT - Make the column nullable if appropriate
- Check the generated INSERT statement
Detailed fix by platform
SQL
ALTER TABLE dbo.Users ADD CONSTRAINT DF_Users_Status DEFAULT 'active' FOR Status;
How to diagnose
- Column — NOT NULL?
- Default — Defined?
- 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:
Similar errors
Most viewed in SQL
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 18 Nov 2026