Creating Policy using SQL Server 2008

The following steps will guide you through a sample of Policy Based Management using SQL Server 2008. Here we will create a Table Naming Convention policy to enforce that the Table Name should start with “tbl” and will evaluate later.

Create the ‘Table Naming Convention’ condition

  1. In Object Explorer, expand Management, expand Policy Management, expand Facets, right-click Table, and then click New Condition
  2. In the Create New Condition dialog box, in the Name box, type Table starts with tbl lick
  3. In the Facet box, confirm that Table is selected.
  4. In Expression area, in the Field box, select @Name, in the Operator box select LIKE, and in the Value type “tbl%”
  5. Optionally, you can type a description of the condition, by clicking on the Description tab.

Create the ‘Table Naming Conventions’ policy

  1. In Object Explorer, right-click  Policies, and then click  New Policy
  2. In the Create New Policy dialog box, in the Name box, type Table Naming Conventions
  3. Select the Enabled box, to enable the policy
  4. In Against Targets, verify that Every Table in Every Database is selected.
  5. In Execution Mode, select  On Change_Prevent

Evaluate the ‘Table Naming Conventions’ policy

  1. In Object Explorer, right-click  Policies, and then click  Evaluate
  2. A new dialogue box will pop-up showing the results against the Policy Evaluation