{"id":14244,"date":"2019-12-17T08:36:24","date_gmt":"2019-12-17T08:36:24","guid":{"rendered":"https:\/\/dbtut.com\/?p=14244"},"modified":"2019-12-17T08:41:13","modified_gmt":"2019-12-17T08:41:13","slug":"dynamic-data-maskingddm-in-sql-server","status":"publish","type":"post","link":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/","title":{"rendered":"Dynamic Data Masking(DDM) in SQL Server"},"content":{"rendered":"<h2>What is Dynamic Data Masking?<\/h2>\n<p>Dynamic Data Masking is a feature announced in SQL Server 2016. With Dynamic Data Masking, you can restrict unauthorized access to your data.<\/p>\n<p>Microsoft introduced serious innovations about the data security with SQL Server 2016. Two of these features are Always Encrypted and Row-Level Security. You can find detailed information in the following articles.<\/p>\n<p>&#8220;<a href=\"https:\/\/dbtut.com\/index.php\/2019\/04\/08\/what-is-always-encrypted-in-sql-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">What is Always Encrypted in SQL Server<\/a>&#8220;,<br \/>\n&#8220;<a href=\"https:\/\/dbtut.com\/index.php\/2019\/12\/16\/row-level-security-in-sql-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">Row Level Security in SQL Server<\/a>&#8221;<\/p>\n<h3>What is the difference between masking and encryption?<\/h3>\n<p>With DDM, we do not encrypt the data in the database. We ensure that critical columns are not visible to people even if they have select permission on the table. For users who need to read critical columns, extra privileges are required except select permission. I will share the scripts that grant extra permission to read critical columns with DDM.<\/p>\n<p>Before this feature was announced, we were able to do column level encryption. You can find the details in the article &#8220;<a href=\"https:\/\/dbtut.com\/index.php\/2018\/09\/03\/column-level-encryption-on-sql-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">Column Level Encryption On SQL Server<\/a>&#8220;. You can understand the differences by reading both articles.<\/p>\n<p>Let&#8217;s continue by making an example. Suppose we have a customer table. In this table there is critical information such as customer&#8217;s identitiy number, email address, mobile phone and birthdate. You may not want the customer representative to see this information. In such a case, it is useful to use DDM.<\/p>\n<h2>Dynamic Data Masking Functions<\/h2>\n<p>With DDM, we can encrypt data with 4 different function.<\/p>\n<h3>1) Default<\/h3>\n<p>This masking method allows masking according to the data type of the column to be masked.<\/p>\n<p>If column is a data type such as binary, varbinary, image, masking is done with a <strong>single byte value of 0<\/strong>.<\/p>\n<p>For date type columns, the value <strong>01.01.1900 00: 00: 00.0000000<\/strong> is used.<\/p>\n<p>For string type columns, the value <strong>XXXX<\/strong> is used.<\/p>\n<p>For Numeric type columns, an <strong>empty<\/strong> value is used.<\/p>\n<h3>2) Random<\/h3>\n<p>Replaces data of the Numeric type with a random number value within the range specified by the random function.<\/p>\n<h3>3) Email<\/h3>\n<p>It takes only the first letter of the email and changes the rest to &#8220;<strong>XXX@XXXX.com<\/strong>&#8220;.<\/p>\n<h3>4) Custom<\/h3>\n<p>It allows us to encrypt data with our own encryption function.<\/p>\n<h2>SQL Server Data Masking Example<\/h2>\n<p>Create a table with the following script and insert sample records into the table. phone numbers was inserted randomly. You should not call the phone numbers. \ud83d\ude42<\/p>\n<pre class=\"lang:default decode:true\">CREATE TABLE [dbo].[Customer](\n\t[IdentityNo] [char](11) NULL,\n\t[Name] [varchar](200) NULL,\n\t[Email] [varchar](200) NULL,\n\t[GSM] [char](11) NULL,\n\t[ProductInfo] [varchar](500) NULL,\n\t[BirthDate] [datetime] NULL,\n\t[NumberofChildren] [smallint] NULL\n) ON [PRIMARY]<\/pre>\n<pre class=\"lang:default decode:true \">INSERT INTO [dbo].[Customer]([IdentityNo],[Name],[Email],[GSM],[ProductInfo],[BirthDate],[NumberofChildren])\n\t\t   VALUES (16985463254, \n\t\t           'Nurullah \u00c7AKIR',\n\t\t\t\t   'dbtut.com@gmail.com',\n\t\t\t\t   '09991111111',\n\t\t\t\t   'Coat',\n\t\t\t\t   '1980-01-01',\n\t\t\t\t   2),\n\t\t          ( 16985463255, \n\t\t\t\t   'Hakan G\u00dcRBA\u015eLAR',\n\t\t\t\t   'hakangurbaslar@gmail.com',\n\t\t\t\t   '09992222222',\n\t\t\t\t   'Trousers',\n\t\t\t\t   '1980-01-01',\n\t\t\t\t   1),\n\t\t\t\t  ( 16985463256, \n\t\t\t\t  'Faruk ERDEM',\n\t\t\t\t  'farukerdem@gmail.com',\n\t\t\t\t  '09993333333',\n\t\t\t\t  'Shirt',\n\t\t\t\t  '1990-01-01',\n\t\t\t\t  0)<\/pre>\n<p>When we select from our table, the result will be as follows.<\/p>\n<p id=\"iExqDUU\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"182\" class=\"size-full wp-image-14245  aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/img_5df7408d22045.png\" alt=\"\" \/><\/p>\n<h3>Masking by using Default Function<\/h3>\n<p>Mask the identity number column with the default method using the following script.<\/p>\n<pre class=\"lang:default decode:true \">ALTER TABLE Customer  \nALTER COLUMN IdentityNo char(11) MASKED WITH (FUNCTION = 'default()');<\/pre>\n<p>When we select our table again, we will see all the data unencrypted. Because, this operation is invalid for sysadmins and db_owners.<\/p>\n<p>Create a login and grant db_datareader permission. Then, try to select from this table with this login. You may want to read the article &#8220;<a href=\"https:\/\/dbtut.com\/index.php\/2018\/08\/28\/how-to-create-a-login-on-sql-servermanage-logins\/\" target=\"_blank\" rel=\"noopener noreferrer\">How To Create a Login On SQL Server(Manage Logins)<\/a>&#8220;.<\/p>\n<p>Instead of granting db_datereader permission, you can also GRANT Select permission as follows.<\/p>\n<pre class=\"lang:default decode:true \">GRANT SELECT ON dbo.Customer TO DDMLogin<\/pre>\n<p>As you can see below, the login we grant Select permission can read the data as masked.<\/p>\n<p id=\"jEROeaS\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"175\" class=\"size-full wp-image-14246  aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/img_5df795bbb1430.png\" alt=\"\" \/><\/p>\n<h3>Masking by using Email Function<\/h3>\n<p>Mask it as follows with the email method and select again from the table with DDMUser.<\/p>\n<pre class=\"lang:default decode:true \">ALTER TABLE Customer  \nALTER COLUMN Email varchar(200) MASKED WITH (FUNCTION = 'Email()');<\/pre>\n<p>As you can see, it took only the first letter of the Email column and masked the rest as &#8220;XXX@XXXX.com&#8221;.<\/p>\n<p id=\"sgHQAeq\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"172\" class=\"size-full wp-image-14247  aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/img_5df796779c5ee.png\" alt=\"\" \/><\/p>\n<h3>Masking by using Random Function<\/h3>\n<p>Mask the NumberofChildren column with the random method using the following script. It replaces the specified column values with a random value between 10 and 30.<\/p>\n<pre class=\"lang:default decode:true \">ALTER TABLE Customer  \nALTER COLUMN NumberofChildren smallint MASKED WITH (FUNCTION = 'random(10,30)');<\/pre>\n<p>As you can see below, although Faruk is not married, Faruk seems to have 29 children. \ud83d\ude42<\/p>\n<p id=\"hRqVWKw\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"184\" class=\"size-full wp-image-14248  aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/img_5df797719fece.png\" alt=\"\" \/><\/p>\n<h3>Masking by using Custom Function<\/h3>\n<p>Mask the Name column with the Custom method using the following script. In this method, it first lists 2 letters of the relevant column, then XXXX, and finally the last 2 letters.<\/p>\n<pre class=\"lang:default decode:true \">ALTER TABLE Customer  \nALTER COLUMN Name varchar(200) MASKED WITH (FUNCTION = 'partial(2,\"XXXX\",2)');<\/pre>\n<p id=\"EWZfLaI\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"161\" class=\"size-full wp-image-14249  aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/img_5df7981c88fdd.png\" alt=\"\" \/><\/p>\n<h3>Grant Unmask Permission To See Unmasked Data<\/h3>\n<p>We can Grant Unmask Permission to logins to see the original version of the masked data with the following script.(This script can be executed only sysadmins or db_owners)<\/p>\n<pre class=\"lang:default decode:true \">GRANT UNMASK TO DDMLogin<\/pre>\n<h3>Revoke Unmask Permission<\/h3>\n<pre class=\"lang:default decode:true \">REVOKE UNMASK TO DDMLogin<\/pre>\n<h3>Dropping Masking<\/h3>\n<p>We can drop the dynamic data masking on the table with the following script.<\/p>\n<pre class=\"lang:default decode:true \">ALTER TABLE Customer\nALTER COLUMN NumberofChildren DROP MASKED;<\/pre>\n<p>We need ALTER ANY MASK permission to perform the masking operations. Right-click the database, click properties, you can then grant permissions for specific users from the permission tab.<\/p>\n<h2>SQL Server Data Masking Limitations<\/h2>\n<p><strong>You can not mask;<\/strong><\/p>\n<p>Encrypted columns,<\/p>\n<p>Filestream columns,<\/p>\n<p>Column_set or a sparse column if its a part of a column_set,<\/p>\n<p>Computed Columns(You can mask columns those creates computed columns. Thus computed column can be masked)<\/p>\n<p>You can not specify masked columns as a key for FULLTEXT index.<\/p>\n\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_14244\" class=\"pvc_stats all  \" data-element-id=\"14244\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is Dynamic Data Masking? Dynamic Data Masking is a feature announced in SQL Server 2016. With Dynamic Data Masking, you can restrict unauthorized access to your data. Microsoft introduced serious innovations about the data security with SQL Server 2016. Two of these features are Always Encrypted and Row-Level Security. You can find detailed information &hellip;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_14244\" class=\"pvc_stats all  \" data-element-id=\"14244\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":14265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[6692,6689,6688,6690,6691,6673,6674,6698,6694,6697,6693,6696,6695,6687,6699,6672,6676,6684,6683,6685,6686,6682,6681,6675,6700,6701,6702,6679,6677,6680,6678,6703],"class_list":["post-14244","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-mssql","tag-data-masking-example-in-sql-server","tag-data-masking-functions-in-sql-server","tag-data-masking-in-sql","tag-data-masking-in-sql-server","tag-data-masking-techniques-in-sql-server","tag-dynamic-data-masking","tag-dynamic-data-masking-in-sql-server","tag-masking-and-unmasking-in-sql-server","tag-masking-columns-in-sql-server","tag-masking-data-in-sql-server","tag-masking-email-address-in-sql-server","tag-masking-fields-in-sql-server","tag-masking-functions-in-sql-server","tag-masking-in-sql-server","tag-masking-script-in-sql-server","tag-sql-server-2019-static-data-masking","tag-sql-server-data-masking","tag-sql-server-data-masking-example","tag-sql-server-data-masking-functions","tag-sql-server-data-masking-limitations","tag-sql-server-data-masking-script","tag-sql-server-data-masking-vs-encryption","tag-sql-server-database-masking","tag-sql-server-masking","tag-sql-server-masking-functions","tag-sql-server-masking-sensitive-data","tag-sql-server-masking-vs-encryption","tag-what-is-data-masking-and-how-it-works","tag-what-is-data-masking-in-sql-server","tag-what-is-dynamic-masking","tag-what-is-masking-in-database","tag-what-is-the-difference-between-masking-and-encryption"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Dynamic Data Masking(DDM) in SQL Server - Database Tutorials<\/title>\n<meta name=\"description\" content=\"Dynamic Data Masking(DDM) in SQL Server\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dynamic Data Masking(DDM) in SQL Server - Database Tutorials\" \/>\n<meta property=\"og:description\" content=\"Dynamic Data Masking(DDM) in SQL Server\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Database Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-17T08:36:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-17T08:41:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"470\" \/>\n\t<meta property=\"og:image:height\" content=\"318\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"dbtut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dbtut\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\"},\"author\":{\"name\":\"dbtut\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\"},\"headline\":\"Dynamic Data Masking(DDM) in SQL Server\",\"datePublished\":\"2019-12-17T08:36:24+00:00\",\"dateModified\":\"2019-12-17T08:41:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\"},\"wordCount\":772,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png\",\"keywords\":[\"data masking example in sql server\",\"data masking functions in sql server\",\"data masking in sql\",\"data masking in sql server\",\"data masking techniques in sql server\",\"dynamic data masking\",\"dynamic data masking in SQL Server\",\"masking and unmasking in sql server\",\"masking columns in sql server\",\"masking data in sql server\",\"masking email address in sql server\",\"masking fields in sql server\",\"masking functions in sql server\",\"masking in sql server\",\"masking script in sql server\",\"sql server 2019 static data masking\",\"sql server data masking\",\"sql server data masking example\",\"sql server data masking functions\",\"sql server data masking limitations\",\"sql server data masking script\",\"sql server data masking vs encryption\",\"sql server database masking\",\"sql server masking\",\"sql server masking functions\",\"sql server masking sensitive data\",\"sql server masking vs encryption\",\"What is data masking and how it works?\",\"What is data masking in SQL Server?\",\"What is dynamic masking?\",\"What is masking in database?\",\"What is the difference between masking and encryption?\"],\"articleSection\":[\"MSSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\",\"url\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\",\"name\":\"Dynamic Data Masking(DDM) in SQL Server - Database Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png\",\"datePublished\":\"2019-12-17T08:36:24+00:00\",\"dateModified\":\"2019-12-17T08:41:13+00:00\",\"description\":\"Dynamic Data Masking(DDM) in SQL Server\",\"breadcrumb\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png\",\"width\":470,\"height\":318},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dbtut.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dynamic Data Masking(DDM) in SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dbtut.com\/#website\",\"url\":\"https:\/\/dbtut.com\/\",\"name\":\"Database Tutorials\",\"description\":\"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux\",\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dbtut.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dbtut.com\/#organization\",\"name\":\"dbtut\",\"url\":\"https:\/\/dbtut.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"width\":223,\"height\":36,\"caption\":\"dbtut\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\",\"name\":\"dbtut\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"caption\":\"dbtut\"},\"description\":\"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.\",\"sameAs\":[\"http:\/\/NurullahCAKIR\"],\"url\":\"https:\/\/dbtut.com\/index.php\/author\/dbtut\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dynamic Data Masking(DDM) in SQL Server - Database Tutorials","description":"Dynamic Data Masking(DDM) in SQL Server","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"Dynamic Data Masking(DDM) in SQL Server - Database Tutorials","og_description":"Dynamic Data Masking(DDM) in SQL Server","og_url":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/","og_site_name":"Database Tutorials","article_published_time":"2019-12-17T08:36:24+00:00","article_modified_time":"2019-12-17T08:41:13+00:00","og_image":[{"width":470,"height":318,"url":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png","type":"image\/png"}],"author":"dbtut","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dbtut","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#article","isPartOf":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/"},"author":{"name":"dbtut","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408"},"headline":"Dynamic Data Masking(DDM) in SQL Server","datePublished":"2019-12-17T08:36:24+00:00","dateModified":"2019-12-17T08:41:13+00:00","mainEntityOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/"},"wordCount":772,"commentCount":0,"publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png","keywords":["data masking example in sql server","data masking functions in sql server","data masking in sql","data masking in sql server","data masking techniques in sql server","dynamic data masking","dynamic data masking in SQL Server","masking and unmasking in sql server","masking columns in sql server","masking data in sql server","masking email address in sql server","masking fields in sql server","masking functions in sql server","masking in sql server","masking script in sql server","sql server 2019 static data masking","sql server data masking","sql server data masking example","sql server data masking functions","sql server data masking limitations","sql server data masking script","sql server data masking vs encryption","sql server database masking","sql server masking","sql server masking functions","sql server masking sensitive data","sql server masking vs encryption","What is data masking and how it works?","What is data masking in SQL Server?","What is dynamic masking?","What is masking in database?","What is the difference between masking and encryption?"],"articleSection":["MSSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/","url":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/","name":"Dynamic Data Masking(DDM) in SQL Server - Database Tutorials","isPartOf":{"@id":"https:\/\/dbtut.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png","datePublished":"2019-12-17T08:36:24+00:00","dateModified":"2019-12-17T08:41:13+00:00","description":"Dynamic Data Masking(DDM) in SQL Server","breadcrumb":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#primaryimage","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/12\/Ads\u0131z-7.png","width":470,"height":318},{"@type":"BreadcrumbList","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/17\/dynamic-data-maskingddm-in-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbtut.com\/"},{"@type":"ListItem","position":2,"name":"Dynamic Data Masking(DDM) in SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/dbtut.com\/#website","url":"https:\/\/dbtut.com\/","name":"Database Tutorials","description":"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux","publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbtut.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dbtut.com\/#organization","name":"dbtut","url":"https:\/\/dbtut.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","width":223,"height":36,"caption":"dbtut"},"image":{"@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408","name":"dbtut","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","caption":"dbtut"},"description":"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.","sameAs":["http:\/\/NurullahCAKIR"],"url":"https:\/\/dbtut.com\/index.php\/author\/dbtut\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/14244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/comments?post=14244"}],"version-history":[{"count":0,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/14244\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media\/14265"}],"wp:attachment":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media?parent=14244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/categories?post=14244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/tags?post=14244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}