modifying column 'ID'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tashy
    New Member
    • Oct 2006
    • 10

    modifying column 'ID'

    I initially modified the column 'ID' from not allowing NULL to allow, and saved it. But now I will like to change it back to 'not allow'. But it gives me the following error message:

    'Pages' table
    - Unable to modify table.
    Cannot insert the value NULL into column 'ID', table <databasename>. Tmp_Pages'; column does not allow nulls. INSERT fails.
    The statement has been terminated.


    Is there a way I can work around this?
    Using sql 2005
  • frozenmist
    Recognized Expert New Member
    • May 2007
    • 179

    #2
    Hi,
    I suppose the error is because you are having NULL values in the column you are trying to alter to not null.
    That is why the constraint is not applied.
    You can either try to update all those null values to a default value or by deleting the rows with NULL and then apply the constraint.

    Hope this was what you needed
    Cheers

    Comment

    Working...