Non-ISO standard comparison operator found


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.


Phil Streiff


-- 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

  • 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

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.



Avoid altering security within stored procedures


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.


Jeff Foushee


    @Code VARCHAR(30) = NULL

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

    UPDATE MyTable SET Col1 = 'myvalue'

        GRANT EXEC ON testsp_CR0002 to myuser

    GRANT EXEC ON testsp_CR0002 to myuser  --IGNORE:CR0002

    REVOKE SELECT ON dbo.Table1 TO myuser

    DENY EXECUTE ON testsp_CR0002 to myuser


-- 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.


TOP (100) PERCENT found


This rule checks for the phrase “TOP (100) PERCENT”.
This phrase has no bearing unless the percentage is less than 100.
This phrase is commonly generated by creating a view in the SQL Server View Designer.


Jeff Foushee


LastName, FirstName, JobTitle, Department
FROM       HumanResources.vEmployeeDepartment


Download and try the CR0001 analysis rule.


Until now, only MVPs and trainers are entitled to free SQL Enlight Licenses.  Now everyone who authors a custom analysis rule and shares it with the SQL Server Community can also get a free personal license of SQL Enlight For SSMS worth $145.

What you will have to do?

1. Think of a new useful custom analysis rule and implement it.

2. Write a blog post that describes the practice, which it is enforcing and share the rule’s xml file.

You have your rule and post ready, what’s next?

Simply email your rule to or send us link to a blog post describing the rule. Once we check the rule we will give you a free SQL Enlight For SSMS license.

Wondering where to start?

First download and install the latest version of SQL Enlight or SQL Enlight For SSMS.

The Analysis Rule Designer which comes with the tools is not limited by the trial period and you can freely use it to learn create and test your analysis rules.

Here is some resources, which you can use:

More Resources:
We are preparing a step by step tutorial for how to create a custom rule with SQL Enlight and will add a link to it in this post as soon as we have the tutorial published.

If you have any questions, please feel free to contact us.