ApexSQL Enforce

The FixSQL feature

Let’s decide that we don’t want to change our Primary Keys for now and concentrate on another rule in order to demonstrate the FixSQL feature in ApexSQL Enforce.

Blank spaces in object names are, although syntactically permitted, an excellent source for errors and, since they serve no real meaningful purpose, should be avoided when naming objects.

As you can see there is just one database object in the Northwind database that violates this rule: the Order Details table.

This time we’re going to fix this issue, and therefore select “Export FixSQL” from the context menu.

At this point we can decide for which objects “FixSQL” code should be generated and exported to the FixSQL script editor:

The FixSQL script editor allows you to modify and safe the generated script. It doesn’t allow you to directly execute the script against a database. You have to use another tool in order to actually “fix” the detected violation.

Reporting
ApexSQL Enforce offers the generation of HTML reports on the results of a processed rule and/or rulebase. In order to create such a report select “HTML Report…” from the context menu of the result grid.

You can choose among different filter criteria before you actually create the report that looks like the following:

Summary
ApexSQL Enforce provides the following key features:

 

  1. User-defined rules to check SQL Server databases for compliance to these rules
  2. Rule condition can be expressed in a .Net language (VB.Net or C#) accessing a sophisticated object model
  3. “FixSQL” code generator to detected rule violations

Advantages

 

  1. No additional objects added to SQL Server system databases.
  2. Fully customizable rules
  3. Easy condition creation using a .Net language

Disadvantages

 

  1. Basic reporting capabilities

Conclusion
ApexSQL Enforce is a very useful tool for SQL Server development and/or administration teams. It gives you the opportunity to check existing SQL Server databases and servers for compliance against self-defined standards. This, in turn, saves precious time during all phases of the development cycle starting with development and finishing with deployment and production. The tool can instantly be used since it ships with several sample rulebases. However, it is fully-customizable by writing rules that are based upon a .Net language to access the flexible built-in object model.

]]>

Leave a comment

Your email address will not be published.