I have a table A_tbl in my database. I have created a trigger on A_tbl to capture inserted records. Trigger is inserting records in my queue table B_tbl. This table has an Identity column with property "Not for replication" as 1.
A_tbl(Id, name, value) withIdas the primary keyB_tbl(uniqueId, Id) withuniqueIdasIdentitycolumn
Trigger code doing this:
Insert into B_tbl (Id)
select i.Id from inserted
Now my table 'B' is replicated to another DB Server, now when I'm inserting into table 'A' it is causing this error:
Explicit value must be specified for identity column in table 'B_tbl' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column. (Source: MSSQLServer, Error number: 545)
Please help me resolve this issue.