SQL SERVER – 2008 – Introduction to Policy Management – Enforcing Rules on SQL Server

http://blog.sqlauthority.com/2008/06/13/sql-server-2008-introduction-to-policy-management-enforcing-rules-on-sql-server/

Ihave previous written article about SQL SERVER Database Coding Standards and Guidelines Complete List Download . I just received question from one of the blog reader is there any way we can just prevent violation of company policy. Well Policy Management can come into handy in this scenario.

If our company policy is to create all the Stored Procedure with prefix ‘usp’ that developers should be just prevented to create Stored Procedure with any other prefix. Let us see small tutorial how to create conditions and policy which will prevent any future SP to be created with any other prefix.

Let us first create condition which defines that name of the database object should start with ‘usp’.

Now create policy for all the Stored Procedure of the database and assign previously created condition of naming convention to all the Stored Procedure of the database.

Make sure that Policy is enabled.

Now try to create Stored Procedure with incorrect name. It will not let you create it but will create error.

If you try to create Stored Procedure prefixed with ‘usp’ it will create it successfully.

Policy Management is very detailed subject and I will write more tutorial about this subject in future.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值