I have an Transactional replication set up form Server A to Server B.
I have a table which has an Identity column as a primary key.
In my publisher ,for the table tb1
,the the identity column,Id1
was set as "Not for Replication"
as Yes.
I used to get the error message "Cannot insert explicit value for idntity column in table tb1 when IDENTITY_INSERT is set to OFF"
But when i checked my subscriber ,i saw that the same column as set as as "Not for Replication"
as No.
So i used the below script to change the setting in my subscriber tb1.
alter table [dbo].[tb1] alter column [Id1] add not for replication;
And the "Not for Replicaiton" is set as "Yes" in my subscriber too.
So what ever Id1 value in the source should be replicated to the subscriber table as well.
But now i get the below error message
"Explicit value must be specified for identity column in table tb1 when IDENTOTY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identtity column"
Seems like the explcit identity value in Id1 is not being passed from publisher.
Any suggestions on this.