Incorrect syntax near 'masked'

  • Hi friends,

    As currently we dont have any category to discuss SQL Server 2016 problems so I am posting it here.

    I was exploring data masking feature of SQL server 2016 CPT3 version.

    But Whenever I tried to add masking to any column it gives me error: Incorrect syntax near 'masked'

    Here is the syntax that I have written-

    ALTER TABLE Demo_Masking

    ALTER COLUMN Salary ADD MASKED WITH (FUNCTION = 'random(1000,90000)');

    I have enabled the trace flags 209,219 for data masking. But still I am getting this error.

    Can anyone help me on this.

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Hey folks I found the solutions for this -

    For version SQL Server 2016 CTP 3 we do not need to run DBCC TRACEON (209,219,-1) else it will show the error.

    For version earlier than CTP 2.1 we need to enable the trace flags.

    So, when I run the command DBCC TRACEOFF(209,219,-1) and then run my alter statement it worked.

    Thanks all 🙂

    Hope it will help others

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply