Welcome, Guest
Username: Password: Remember me

TOPIC: Error: cannot update identity column 'id' limesurvey

Error: cannot update identity column 'id' limesurvey 2 years 10 months ago #61514

Hi-

I'm running Lime 1.9+ and SQL Server 2008 R2 on WS 2008. I have set a few surveys that work fine except if you want to update the responses through LimeSurvey. If you try to do that, you get this message:

Update failed:
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot update identity column 'id'.
UPDATE [lime_survey_89518] SET [id] = '6', ... WHERE id=6

So, it's basically trying to update the identity field "ID" which you can't do in sql server. Is there some way to fix those so we can edit the responses through LimeSurvey?

Thanks!!
Last Edit: 2 years 10 months ago by PDATechSupport.
The administrator has disabled public write access.

Re: Error: cannot update identity column 'id' limesurvey 2 years 10 months ago #61896

OK, I figured out a fix for this. I removed Primary Key status from the ID field and made it nullable. In order to maintain row uniqueness, I did create another field and made it the non-null identity (that never gets used by limesurvey).

I created a sql trigger that gets called after a new row is inserted. The trigger populates the ID field with a value that is = Max(ID) + 1. This is not very pretty, but it's working fine for this survey.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.091 seconds
Donation Image