Dela via


How to: Enable and Disable Specific Rules for Static Analysis of Database Code

You can more easily identify design and performance issues in your database by running specific rules as part of static analysis for database code. For example, you can run rules that are likely to identify common problems after every build and then run all rules before the end of a development milestone. You can also specify different sets of rules for different build configurations.

To enable or disable specific rules for static analysis of database code

  1. Open the solution that contains the database project for which you want to enable or disable specific rules.

  2. In Solution Explorer, click the database project.

  3. On the Data menu, point to Static Code Analysis, and click Configure.

    The project properties window opens, displaying the Code Analysis tab.

  4. In the Configuration list, click the configuration for which you want to enable or disable specific rules.

  5. To enable a rule, select the check box for that rule.

  6. To disable a rule, clear the check box for that rule.

  7. To treat each violation of a rule as an error instead of a warning, select the Treat Warning as Error check box.

    Note

    You can select or clear the check box for a group of rules (Design, Naming, or Performance) to enable or disable all rules in that group. You can also select or clear the Treat Warning as Error check box for a group of rules. To enable, disable, or treat as errors most rules in a group, you can select or clear the check box for the group and then select or clear check boxes for specific rules.

See Also

Tasks

How to: Enable and Disable Static Analysis for Database Code

How to: Analyze Transact-SQL Code to Find Defects

Walkthrough: Analyze Transact-SQL Code for an Existing Database

Concepts

Analyzing Database Code to Improve Code Quality

Analyzing Managed Code Quality by Using Code Analysis