Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Why is the insert trigger on the subscriber table causing the following replication error?

$
0
0

Hello,

I had set up a transactional sql to sql replication a couple months ago and now the business would like for us to build a real time reporting database off of the data.  However, in each table in the reporting database, they would like us to add the following columns: Deleted_Date, and Duplicate_Date.  These dates will let them know when the record was deleted or came through as a duplication.  So that eliminated the idea of using transactional replication and I started looking into triggers.  As a test, I created an insert, update, and delete triggers on one of the tables at the subscriber.  When an insert or delete was executed at the publisher, the insert and delete triggers at the subscriber executed successfully with no issues.  However, if an update is executed at the publisher then replication encountered the following error below.  If I delete the insert trigger on the table then replication is happy and continues.  After further research, I found that 'If any column that is part of a unique constraint is updated, then SQL Server implements the update as a "deferred update", which means as a pair of DELETE/INSERT operations'.  I did check the columns that are being updated and they are not part of a unique constraint or primary key so I'm at a dead end.  Any ideas or workaround?  Thanks.

http://support.microsoft.com/kb/238254

Command attempted:

if @@trancount > 0 rollback tran
(Transaction sequence number: 0x00000F8D0001F13A000F00000000, Command ID: 2)

Error messages:
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction. (Source: MSSQLServer, Error number: 3930)
Get help: http://help/3930
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction. (Source: MSSQLServer, Error number: 3930)
Get help: http://help/3930

Tae


tae yang






Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>