Edit/update “Cell is readonly” in MS SQL

3 Sep

If you want to update a cell which is an identity column, you need to do the following:

set identity_insert TABLEX ON;
insert into TABLEX (COLUMNX) values (NN);
delete from TABLEX where COLUMNX = OLDNN
set identity_insert TABLEX OFF;

Read more:

http://en.wikipedia.org/wiki/Identity_column

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/24a4bb02-e00c-4df0-932d-be9d51ec862e/cell-is-read-only

http://stackoverflow.com/questions/828906/how-can-i-change-a-field-in-a-sql-server-database-thats-set-to-read-only-cell

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: