Day: October 16, 2015

Policy Management & Tips

Posted on Updated on


It is interesting how implement code standards for stored procedures in Sql Server, stored procedures system are prefixed with “sp_”, for our user stored procedures, let the prefix of “usp_”, this is done with Policy Management (see SSMS – the object explorer, root).

PM2

Right-click on Policy Management and select New Condition, Type a name and condition as well as the body of your condition, we have decided to select the Name filter expression LIKE (‘usp_%’).

PM0

The next step is to create a policy associated with this codition, right-click Policy Management and select New Policy, select the Check Condition list, the condition created previously, the evaluation mode must be set to “On change: prevent prevention “, the default mode is” on Demand “and policies can not be enabled in this mode, for the Target, make sure you select all the databases and all stored procedures.

PM