469,599 Members | 2,897 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,599 developers. It's quick & easy.

modifying column 'ID'

10
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
May 8 '07 #1
1 1665
frozenmist
179 Expert 100+
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
May 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Albert Valls Rovira | last post: by
3 posts views Thread by Chris | last post: by
2 posts views Thread by chuck | last post: by
1 post views Thread by Trev | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.