SQL Server – Replication with Encrypted Columns and Master Key Requirements

loggingreplicationsql server

I have two questions actually:

If you set up a table with encrypted columns and replicate it to another server does the other server have to have the same master key and symmetric key or is it replicated automatically?

And where replication activity is logged? – Is that inside the windows event viewer?

Best Answer

With ordinary column encryption (not AlwaysEncrypted), the columns are simple varbinary columns, with no special configuration or metadata. So replication of the cyphertext "just works".

To decrypt on the subscriber you would need the symmetric key, either by Creating Identical Symmetric Keys on Two Servers, or by restoring a backup of the publisher database containing the symmetric key before initializing the subscription (and restoring the Certificate or Master Key that encrypts the symmetric key).