SQL Server – Using Dynamic Data Masking to Set Custom String

dynamic-data-maskingsql server

I need to mask the data in the following table.
enter image description here

For example, I need to mask the first_name of the user Roberto to something like NAME<<userID>>, So the end result should look like NAME1

Is this possible in SQL Server?

My SQL Server details below.

enter image description here

I have tried these methods from the documentation but still no luck
from documentation

Best Answer

You cannot refer to data in some other column so if that 1 should come from the MemberId column, then you are out of luck. What you have to play with are the prefix and suffix, and those need to be from the same column as the masking is defined on.