Apply SQL Server Policy to New Objects Only

0

I have set up the naming conventions for views using the SQL Server 2017 Policy Based Management. The rule requires all views to start with "vw_". The evaluation mode is set to "On Change: prevent". It works fine preventing the incorrect naming for newly created objects. But we have a lot of legacy objects that do not comply with this new naming convention. We do not want to change those non-complaint names at the moment but when try to ALTER the old objects the "prevent" rule applies to them as well.

The only way I found is to temporarily disable the policy, alter the object, and enable the policy back.

Is there a way to set up the prevent policy for new objects ONLY leaving me an option to check the old objects on demand?

DmitryV

Posted 2019-10-21T16:50:40.183

Reputation: 31

No answers