Getting "Cannot update identity column" error when I'm not trying to update an identity column
Getting "Cannot update identity column" error when I'm not trying to update an identity column
![dorjragchaa](https://secure.gravatar.com/avatar/5cb379850055621a2cba0b26405d84f7/?default=https%3A%2F%2Fvanillicon.com%2F5cb379850055621a2cba0b26405d84f7_200.png&rating=g&size=120)
Dears
Getting "Cannot update identity column" error when I'm not trying to update an identity column how to fix it ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Dear @allan if you know about this discussion please help me
Hi @dorjragchaa ,
Can you give more information. please, there isn't much to go on here. If you could link to the page, or at a minimum post your front- and back-end code, it would help.
Cheers,
Colin
Also, this thread has the same error, so it would be worth checking that. The error is also in this external thread.
Hi dear @colin
Here is my using table & attached code
user_id is primary key and i updated emai field
CREATE TABLE [dbo].[DWH_LKP_Test_users](
[user_id] [int] IDENTITY(1,1) NOT NULL,
[first_name] varchar NULL,
[last_name] varchar NULL,
[sys_user_name] varchar NULL,
[email] varchar NULL
) ON [PRIMARY]
Hi @dorjragchaa ,
Did you look at those other threads? Did they help?
Cheers,
Colin
Dear @colin
Thanks for your replies
Yes i looked both of them, but no helpful for my case
i think first thread was fix error on database and second was hides their comments and need subscription pricing
In your PHP you have:
You also have
user_id
in your Editor form. But in your original message you said:So I'm not sure what your goal is here. Normally with an identity column you wouldn't include it in the field list for the PHP or Javascript, since the database will handle it automatically and you typically don't show it to the end user.
Perhaps you could clarify what you are trying to do please?
Allan
Hi Dear Allan
I'm sorry. i was trying to show user_id and and make it read only then update other field.Now i understand moving update fileds only to php file.
Thanks a lot , sorry me![:) :)](https://datatables.net/forums/resources/emoji/smile.png)
can be added if you want to only get the field, not set it.
Allan