Click or drag to resize

Analysis Settings

General Analysis Settings

This section contains the following subsections:

settings-analysis-general

Analysis Template Import/Export

Analysis template can be exported in a XML file and later imported on another machine or distributed between team members.

Using the following steps the analysis templates can be imported in SQL Enlight:

  1. Download the latest analysis template from our web site.

  2. Start SQL Server Management Studio or Visual Studio, open SQL Enlight Options and go to Settings -> Analysis Settings item

  3. Create backup of your existing template using the Export button.

  4. Choose how the template will be imported:

    • Completely import and replace the active analysis template with the imported one.

      To use this option, unselect the Update existing rules and groups check box.

    • Import all new rules and update existing rules from the new template, and preserve the rules in the active template that do not exists in the new template. This option is suitable for the case when you have custom rules (with names different than the ones in the new template) which you want to preserve.

      To use this option, make sure that Update existing rules and groups check box is selected.

  5. Use the Import button to select the template file and import it in SQL Enlight.

Reset analysis template

The Reset button under the Export/Import section to reset the current analysis template to the default template.

Note Note

Create a backup of your existing template using, because all changes to the current template, any new rules or changes of existing rules will be lost.

Analysis template inheritance

The setting enables or disables analysis base template inheritance.

Enabling inheritance allows standard rules from the base analysis template to be updated automatically with latest version when a new version of SQL Enlight is installed.

Disabling the inheritance can be useful in case you would want to use only a set of custom analysis rules.

The recommended setting for the inheritance is enabled.

Analysis Context Settings

This section contains the following subsections:

settings-analysis-context

Analysis Context Mode

Choose the detail level of the analysis context:

Basic

Basic mode will load only the most commonly used schema information such as:

  • Server Information
  • Principals, Role Members
  • Schemas
  • Data Types
  • Assemblies
  • Tables, Views, Triggers
  • Functions, Partition Functions, Stored Procedures
  • Rules,Defaults,Synonyms
  • XML Schema Collections
  • Indexes,Foreign Keys, Primary Keys, Check Constraints, Default Constraints
  • FullText Catalogs, Data Spaces, File Groups
  • Dependencies, Partition Schemes
  • Statistics
Full

The Full mode will load all the basic schema information and also some additional database objects:

  • Message Types
  • Service Contracts, Service Queues, Services, Service Bindings
  • Routes
  • SymmetricKeys
  • AsymmetricKeys, Certificates
  • Extended Properties, Event Notifications

Test Analysis Context Connection

The Test Analysis Context Connection specifies the default connection which to be used for generating analysis context in the Analysis Rule Designer.

Context not available warning

If the analysis context cannot be loaded or the SQL Connection to the context database cannot be established, the analysis rules which require context will be disabled.

The setting controls whether a warning to be reported for each analysis rule which is disabled because of the missing analysis context.

Analysis context cache

The setting specifies the location of the disk folder where database and server context information is stored. The disk cache is always enabled and is meant to speed up the loading of database context information.

The default folder is user's application folder:

%APPDATA%\Ubitsoft\SQL Enlight\{version}\Cache\

The location can be changed in order to provide more or free disk space.

SSMS Analysis Settings

This section contains the following subsections:

settings-analysis-ssms

This settings tab contains SQL Server Management Studio specific integration related configuration options.

Instant Code Analysis

Instant Code Analysis enables SQL documents to be analyzed in background using the rules in the current analysis template.

The analysis is triggered a coupe of seconds after a script document is opened for a first time or an opened document has its content changed.

  • Enable Instant Code Analysis

    Enables background analysis.

  • Maximum Script size

    The Maximum script size setting controls the maximum document size, which to be analyzable by the Instant Code Analysis feature.

    Documents with content bigger than the specified limit will be ignored.

    Available values: 100 KB, 200 KB, 500 KB, 5 MB or Unlimited

  • Delay

    The Delay setting specifies delay between the last document change and the start of the code analysis. Default value of the delay is 4000 ms.

  • Disable Instant Code Analysis

    Disables background analysis.

Active code window connection context

Enable or disable loading of the connection context when analyzing statements in the active code window.

When connection context is disabled, SQL Enlight does not attempt to load database context information and works without it. This setting will affect any context analysis rules and any rules which use the context information, but might speed up analysis in case only T-SQL script is analyzed or in case the database connection is not currently available.

The recommended setting for this option is not checked ( the connection context is enabled).

Other Settings

This section contains the following subsections:

settings-analysis-other

Syntax errors

The Disable syntax errors in analysis results setting control weather the syntax errors are reported in the analysis results or ignored.

SQL Server Script Validation Settings

Enable SQL script to be validated by the connected SQL Server instance before doing analysis.

When the setting is enabled, there are two options which are available:

  • Parse - The script is only parsed by the SQL Server and only syntax errors are reported.
  • Parse and Compile - The script is parsed and compiled and syntax and schema errors are reported.

SQLCMD mode support

Configure support for SQLCMD mode commands and variables. If enabled, the script is preprocessed and the SQLCMD variables are replaced before running code analysis.