We are delighted to announce the release of the latest SQL Enlight update – version 1.9.7.821.

This is a release of some exciting user experience improvements on which we worked the past months.

Here is a summary of what’s new in version 1.9.7.821:

  • Instant Code Analysis

    This is probably the most exciting feature in the new release. It allows the analysis to run in the background and get analysis results while a SQL document is edited.

  • Non-blocking UI operations

    The analysis, refactoring and code formatting operations are no more going to block user interface and until the specific operation is completed, but will run asynchronously in the background.

  • Script Summary improvements

    The Script Summary is now opened as a non modal tool window and the summary is updated in the background with the SQL document changes.

  • TFS Policies improvements

    Clicking the analysis violations now will open the file,which is the source of the violation.

  • Enhancements in Error List

    Added several filtering options and other improvements.

  • Other fixes, optimizations and improvements

    We did many other improvements in MSBuild, NAnt tasks and command line tool, and Visual Studio and SQL Server Management Studio integration.

You can download and try the final release of SQL Enlight 1.9.7.821here and the latest version of SQL Enlight for SSMS – here.

 

What’s updated in this release:

  •  Added 19 new analysis rules
  • Improvements in analysis performance
  • Improvements MSBuild and NAnt tasks
  • Fixes of issues found in previous release

What includes this update:

  • Optimizations of the analysis feature
  • Fixes and improvements

Message

Non-ISO standard comparison operator found

Description

It is advisable to use ISO standard comparison operators instead of non-ISO standard operators to help ensure optimal cross-platform and future version compatibility.

  • Not equal to: Use <> instead of !=
  • Greater than or equal to: Use >= instead of !<
  • Less than or equal to: Use <= instead of !>

While it is currently acceptable to use such non-ISO operators, you should consider that statements that you create might not be supported on other ISO-compliant database management systems.

Also, non-ISO standard comparison operators may not be supported on future versions of SQL Server.

Author

Phil Streiff

Example

-- Test Case 1: The violation should be reported
SELECT Column1 FROM Table1 WHERE Column1 != 1
-- Test Case 2: The violation should be reported
SELECT Column1 FROM Table1 WHERE Column1 !< 1
-- Test Case 3: The violation should be reported
SELECT Column1 FROM Table1 WHERE Column1 !> 1

-- Test Case 4: A violation should not be reported
SELECT Column1 FROM Table1 WHERE Column1 <> 1
-- Test Case 5: A violation should not be reported
SELECT Column1 FROM Table1 WHERE Column1 >= 1
-- Test Case 6: A violation should no be reported
SELECT Column1 FROM Table1 WHERE Column1 <= 1

Download and try the CR0003 analysis rule.

Here is what’s changed in this update:

  • Performance optimizations of the analysis feature
  • Fix for LinqBridge.dll validation error

We are happy to announce that the next update of SQL Enlight is already here.

Here is a summary of what’s new in version 1.9.5.764:

  • Support for SQL Server 2014 – T-SQL syntax enhancements and new schema features
  • Support for analyzing SQL Azure databases
  • The Command line tool, NAnt and MSBuild tasks can now accept regular expressions for filtering analysis target objects
  • Several performance optimizations of the analysis feature
  • Fixes and improvements

The new SQL Enlight version can be downloaded here and new version of SQL Enlight for SSMS can be downloaded here.

  • Fixes of issues found in version 1.9.4.752

What’s new in this update:

  • Support for SQL Server Management Studio 2014 integration
  • 64-bit architecture native support
  • Improvements of the command line tool and MSBuild and NAnt tasks

 

The step by step guide for creating custom analysis rules with SQL Enlight is available as a .pdf document here.

If you have any questions, please contact us at our support email or use our feedback form.

 

Message

Avoid altering security within stored procedures

Description

The rule checks and alerts for usage of GRANT, REVOKE, or DENY statements within the body of a stored procedure.
Avoid altering security within stored procedures, functions, and triggers. This can lead to unnecessary database calls, or it can hinder troubleshooting security permissions.

Author

Jeff Foushee

Example

CREATE PROCEDURE testsp_CR0002 (
    @Code VARCHAR(30) = NULL
)
AS

BEGIN
    IF @Code IS NULL
        SELECT * FROM Table1
    ELSE
        SELECT * FROM Table1 WHERE Code like @Code + '%'

    UPDATE MyTable SET Col1 = 'myvalue'

    BEGIN TRAN
        GRANT EXEC ON testsp_CR0002 to myuser
    COMMIT TRAN

    GRANT EXEC ON testsp_CR0002 to myuser  --IGNORE:CR0002

    REVOKE SELECT ON dbo.Table1 TO myuser

    DENY EXECUTE ON testsp_CR0002 to myuser

END

-- this is fine because it is outside of the stored procedure
GRANT EXEC ON testsp_CR0002 to myuser  

Download and try the CR0002 analysis rule.