Export (0) Print
Expand All

How to: Stop Suppressing Warnings for Database Code Analysis

When you analyze the Transact-SQL code in your database project, you can suppress any warning that does not apply to your circumstances. For more information, see How to: Suppress Database Code Analysis Warnings. However, you might want to stop suppressing one or more warnings when your circumstances change.

When you suppress a warning, you create an entry in an XML file in your database project. The XML file is named StaticCodeAnalysis.SuppressMessages.xml. To stop suppressing a particular warning for a particular file, you remove the appropriate entry from the XML file. You can also stop suppressing all warnings for a database project by deleting the XML file.

To stop suppressing a code analysis warning for your database project

  1. Open the solution that contains your database project.

  2. In Solution Explorer, double-click StaticCodeAnalysis.SuppressMessages.xml.

    The file opens in the editor and resembles the following example:

    <?xml version="1.0" encoding="utf-16"?>
    <StaticCodeAnalysis version="1" xmlns="urn:Microsoft.VisualStudio.TeamSystem.Data.StaticCodeAnalysis">
      <SuppressedFile FilePath="Schema Objects\Programmability\Stored Procedures\dbo.Procedure1.proc.sql">
        <SuppressedRule Category="Microsoft.Design" RuleId="SR0008" />
      </SuppressedFile>
    </StaticCodeAnalysis>
    
  3. Find the SuppressedFile node of the file for which you want to stop suppressing one or more warnings.

  4. Perform either of the following steps:

    • To stop suppressing one or more warnings for that file, delete the appropriate SuppressedRule nodes.

    • To stop suppressing all warnings for that file, delete the SuppressedFile node and all its child nodes.

  5. On the File menu, click Save StaticCodeAnalysis.SuppressMessages.xml.

    For each node that you deleted, one or more of these warnings will appear if your code contains potential defects the next time that you analyze it.

To stop suppressing all code analysis warnings for your database project

  1. Open the solution that contains your database project.

  2. In Solution Explorer, click StaticCodeAnalysis.SuppressMessages.xml.

  3. On the Edit menu, click Delete.

    A configuration dialog box appears.

  4. Click OK to permanently delete the XML file, or click Cancel to keep suppressing code analysis warnings for your database project.

Community Additions

ADD
Show:
© 2014 Microsoft