SQL Server column does not allow nulls

Posted on 2013-09-13
Medium Priority
Last Modified: 2013-09-17
The following SQL Server command text raises the error "column does not allow nulls"

INSERT INTO dbo.tbl_PS_ScorecardTmp
VALUES     (111)

The column Scorecard design does allow nulls. Why do I get the error? Thanks
Question by:paulmcneil
  • 2
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 2000 total points
ID: 39491427
seems like there is a non nullable column on your table
LVL 70

Expert Comment

by:Scott Pletcher
ID: 39491429
There is another column in the table that is specified as "NOT NULL" in the table definition.

You need to add a value for any required column(s), for example:

INSERT INTO dbo.tbl_PS_ScorecardTmp
                      (ScorecardID, RequiredColumn1, RequiredColumn2)
VALUES     (111, 'A', 0)
LVL 75

Accepted Solution

Aneesh Retnakaran earned 2000 total points
ID: 39491431
use this query to find
select * from sys.columns where is_nullable = 0 and object_id = object_id('tbl_PS_ScorecardTmp')

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

If Skype for Business came with your office 2016 or office 365 installation, you may find that it's almost impossible to either disable or remove it. The application will often launch with each start of Windows, even when explicitly configured not t…
As a person who answers a lot of questions, I often see code that could be simplified, made easier to read, and perhaps most importantly made easier to maintain if the code was modified to use the Select Case statement. This article explains how to…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question