How do I prevent a column being replicated in SQL server?

Posted on

Question :

I’m on MSSQL 2016 using push-based transactional replication to an Azure instance. I have a few columns in our modeled data that I really do not want to replicate.

Is there a way to flag a column as “do not replicate” or something when defining a table? Or – is there a way to encrypt it such that it cannot be decrypted on a remote server? I know that you can not check the column when setting up the replication, but that feel prone to error and I’d like to have a second line of defense to avoid inadvertent replication.

Answer :

Follow the documentation for define a column filter

https://docs.microsoft.com/en-us/sql/relational-databases/replication/publish/define-and-modify-a-column-filter?view=sql-server-ver15

Leave a Reply

Your email address will not be published. Required fields are marked *