Last active
August 29, 2015 14:21
-
-
Save hsinjungwu/bdf530fbead20f01e945 to your computer and use it in GitHub Desktop.
add mask to data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @name NVARCHAR(20) = N'王小明' | |
DECLARE @mask_name NVARCHAR(20) | |
SELECT @mask_name = STUFF(@name, 2, LEN(@name)-1, REPLICATE ('*' , LEN(@name)-1)) | |
PRINT @mask_name | |
-- @mask_name = 王** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment