Indentity_insert

Mar 21, 2001

Hi,

I recieved this error

----------------------------------------------
Error Diagnostic Information
ODBC Error Code = 23000 (Integrity constraint violation)


[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'user_jobbag' when IDENTITY_INSERT is set to OFF.
-----------------------------------------------

I collect the @@identity [identity_insert] from the last record
and try to enter this @@identity into a new table.

it working before but it doesn't work now and pop up the above error.

I then trying to replace the @@identity with another query that collect the
same id but the same error pop up when I don't even use it.?

if anyone know about this problem, please advice me via email.

thank you all in advance.

Giang.

View 2 Replies


ADVERTISEMENT

Inserting Record Setting INDENTITY_INSERT ON With Replication

May 16, 2008



A user inadvertantly deleted a record in a table that maintains an identity seed. I attempted to insert the record using SET IDENTITY_INSERT ON, but forgot that this table is an article in merge replication. I am attempting the insert on the publisher and I get the following message:


Msg 548, Level 16, State 2, Line 2

The insert failed. It conflicted with an identity range check constraint in database 'cad', replicated table 'dbo.emmain', column 'empl_id'. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent.

The statement has been terminated.


How can I re-insert this record??Thanks in advance for any help

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved