CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft OLE DB Provider for SQL Server error '80040e2f' Cannot insert the value NULL into column

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    100
  • Date Created
    Wednesday, February 9, 2011
  • Last Updated
    Wednesday, June 20, 2012
  • This Article Has been Viewed
    10140 times
  • Short Desc
    This issue will happen when your SQL Server data Column is set to not Allow Null and it is not set as the Identity for the table.
  • Details
    When you uncheck the [Allow Nulls]
    For your Data Column, for the INT Data Type.
    Make sure that you set it as Identity.
    If not, you will recieve the following error when trying to INSERT a new record.

     
    Microsoft OLE DB Provider for SQL Server error '80040e2f'
    Cannot insert the value NULL into column 'EVID', table 'ev.Content'; column does not allow nulls. INSERT fails.
    /Create.asp, line 37

  • Recreate Issue
    To recreate this issue.
    Have your SQL Server data ID Column set to not allow null
    And not set as the Primary Idenity
  • Resolve Issue
    To correct this issue:

    Inside SQL Server Management Studio (2005, this should be the same in 2008 as well, 2000 I am not sure about)

    Right Click on the Table
    Choose [Design]
    Click ont he Column name (In our case it is EVID)
    In the [Column Properties] at the bottom
    Scroll down to [Identity Specification]
    Click on teh [+]
    [(Is Identity)] Choose: [Yes]
    Ctrl + S (To Save)
    (or)
    Click on the [Save] Icon in the Taskbar
    (or)
    File Menu click [Save]