DaveWentzel.com            All Things Data

Replication

How do I prevent a user from updating a read-only subscriber?  

 

CREATE TRIGGER prevent_user_dml
ON Person.Address
FOR INSERT, UPDATE, DELETE
NOT FOR REPLICATION
AS
SET XACT_ABORT OFF
ROLLBACK

This can be added programmatically by using the @post_snapshot_script option of  sp_addpublication.   SET XACT_ABORT OFF is needed so only the current statement is rolled back, not the entire batch.  

 

Why are my replicated views, functions, and stored procs not shown in sysarticles

[Freelinking: unknown plugin indicator "Replication"]

DBA Topics

SQL Server Home

Add new comment