This topic contains an architecture overview of the SQL Enlight analysis feature.

This topic contains the following sections:


SQL Enlight Analysis feature depends on several components:

SQL Parser

Parses the T-SQL code and results in an XML-based syntax tree of the SQL source code (SQML).

Schema Reader

Load databases and server schema, and generate XML DOM representation of it (Analysis Context).

Analysis Engine

Validates, Compiles XSLT analysis rules and applies them to the SQML and XML Analysis Context.

XSLT Extensions

Can be used by the analysis rules and provide some additions to the standard XSLT and XPath functions as well as access to some of the internal SQL Enlight features.


The analysis goes through several steps:

  1. Parse T-SQL code, validate the syntax and generate SQML.



  2. Load database context and generate Analysis Context XML.



  3. Generate XSLT template from available analysis rules expressions.

  4. Apply XSLT transformation on the SQML of each T-SQL batch using all active batch scoped analysis rules. The analysis context and rule parameters are provided to the analysis rule as XSLT variables.

  5. Apply XSLT transformation on the Analysis Context XML using all active Context Only analysis rules. The rule parameters and the analysis context are provided to the analysis rule as XSLT variables.

  6. Reports rule violations.



See Also