I'm implementing SQL Server 2016 Data Masking as a test as part of an overarching effort to give an application a 'demo' mode which doesn't expose real data when showcased.
We have a mobile number field which follows the pattern 0411 222 333 (Australian mobile number), and the partial mask below correctly applies the standard mask we're after, which is to say 04XX XXX X33
ALTER TABLE Resource
ALTER COLUMN MobileNumber ADD MASKED WITH (FUNCTION='partial(2, "XX-XXX-X",2)')
However, if the value of the column is an empty string, (''), the mask is still applied, albeit with no data to mask:
Is there a way to ensure empty strings are ignored by the masking effort?
