HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Masking or substring data while replicating data

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
maskingwhilesubstringreplicatingdata

Problem

I have a table that has some unencrypted data that needs to be replicated to another server. I want to do :

-
Mask the data with an x except the last 5 characters e.g. xxxx12345

-
just replicate the last 5 characters of the data in the column (substr the last 5 characters)

Is there a way I can do that other than writing a trigger on the subscriber ?

Thanks

R

Solution

Yes, you can use custom replication stored procedures to do this. Custom replication stored procedures are especially useful when an application requires custom logic such as this and can allow the data to be transformed in-flight to Subscribers.

Have a look at the sections Default and custom stored procedures and Considerations for Using Custom Stored Procedures in Specify How Changes Are Propagated for Transactional Articles, and the section To generate and use custom stored procedures in Set the Propagation Method for Data Changes to Transactional Articles.

Context

StackExchange Database Administrators Q#57509, answer score: 2

Revisions (0)

No revisions yet.