Click or drag to resize

Analysis Rules

SQL Enlight users can create their own groups and custom analysis rules. For more details see Manage Analysis Rules topics.

Categories
All rules

EX0004 : Find identifier references inside the T-SQL script

EX0005 : Check script for data modifying statements - INSERT,UPDATE,DELETE or EXECUTE

EX0006 : Identify possible missing Foreign Keys

EX0007 : List all DML and DDL triggers in current database

EX0009 : Consider adding proper comment block before each database object create statement

EX0010 : Identify missing indexes using dynamic management views information

EX0011 : Identify inefficient indexes using dynamic management views information

EX0012 : Displays memory usage information for the current database

EX0013 : Identify fragmented indexes that need rebuilding or re-indexing

EX0014 : List the last execution status of all available SQL Server jobs

EX0015 : Find Best Clustered Index

EX0018 : Analyze execution plan and check for high cost operations

SA0001 : Equality and inequality comparisons involving a NULL constant found. Use IS NULL or IS NOT NULL

SA0002 : Variable declared but never referenced or assigned

SA0003 : Variable used but not previously assigned

SA0004 : Variable assigned but value never used

SA0005 : Non-ANSI outer join syntax

SA0006 : Non-ANSI inner join syntax

SA0007 : Pattern starting with "%" in LIKE predicate

SA0008 : Deprecated syntax string = expression_alias

SA0009 : Consider using a table variable instead temporary table

SA0010 : Use TRY..CATCH or check the @@ERROR variable after executing data manipulation statement

SA0011 : SELECT * in stored procedures, views and table-valued functions

SA0012 : Use SCOPE_IDENTITY() instead @@IDENTITY

SA0013 : Avoid returning results in triggers

SA0014 : Avoid 'fn_' prefix when naming functions

SA0015 : Avoid 'sp_' prefix when naming stored procedures

SA0016 : Use of very small variable length type (size 1 or 2)

SA0017 : SET NOCOUNT ON option in stored procedures and triggers

SA0018 : Support for constants in ORDER BY clause have been deprecated

SA0019 : TOP clause used in a query without an ORDER BY clause

SA0020 : Always use a column list in INSERT statements

SA0021 : Deprecated usage of table hints without WITH keyword

SA0022 : Index type (CLUSTERED or NONCLUSTERED) not specified

SA0023 : Avoid using not equal operator (<>,!=) in the WHERE clause

SA0024 : Local cursor not closed

SA0025 : Local cursor not explicitly deallocated

SA0026 : Local cursor variable not explicitly deallocated

SA0027 : Avoid wrapping filtering columns within a function in the WHERE clause

SA0028 : [Deprecated]Function call can be extracted from the WHERE clause to avoid unnecessary table scan

SA0029 : Input parameter never used

SA0030 : Output parameter never assigned

SA0031 : Avoid GOTO statement to improve readability

SA0032 : Avoid using NOT IN predicate in the WHERE clause

SA0033 : [Deprecated]Do not use the GROUP BY clause without an aggregate function

SA0034 : Use parentheses to improve readability and avoid mistakes because of logical operator precedence

SA0035 : TODO,HACK or UNDONE phrase found in a comment

SA0036 : DELETE statement without row limiting conditions

SA0037 : UPDATE statement without row limiting conditions

SA0038 : The comparison expression evaluates to TRUE

SA0039 : The comparison expression evaluates to FALSE

SA0040 : Consider moving the column reference to one side of the comparison operator in order to use the column index

SA0041 : Avoid joining with views

SA0042A : Avoid using special characters in object names. (Context Only)

SA0042B : Avoid using special characters in object names. (Batch)

SA0043A : Avoid using reserved words for type names. (Context Only)

SA0043B : Avoid using reserved words for type names. (Batch)

SA0044 : Consider creating indexes on all columns included in foreign keys

SA0045 : Consider updating statistics as they appear outdated and may mislead the query optimizer

SA0046 : Consider creating statistics on all composite index columns

SA0047 : Consider indexing the column as it is used in a WHERE clause or JOIN condition

SA0048 : Table does not have a primary key or unique key

SA0048B : The table is created without a a primary key

SA0049 : Table does not have a clustered index

SA0049B : The table is created without a clustered index

SA0050 : Do not create clustered index on UNIQUEIDENTIFIER columns

SA0050B : Do not create clustered index on UNIQUEIDENTIFIER columns

SA0051 : The query is missing a join predicate. This may affect or result more than expected rows

SA0052 : Avoid using undocumented and deprecated stored procedures

SA0053A : Don’t use deprecated TEXT,NTEXT and IMAGE data types. (Context Only)

SA0053B : Don’t use deprecated TEXT,NTEXT and IMAGE data types. (Batch)

SA0054 : Avoid modification of parameters in a stored procedure prior to use in a query

SA0055 : Consider indexing the columns referenced by IN predicates in order to avoid table scans

SA0056 : Index has exact duplicate or overlapping index

SA0057 : Consider using EXISTS predicate instead of IN predicate

SA0058 : Avoid converting dates to string during date comparison

SA0059A : Check database for objects created with different than default or specified collation

SA0059B : Check for usage of collation different than the database default or the specified collation

SA0060 : The sp_xml_preparedocument procedure call is not paired with a following sp_xml_removedocument call

SA0061A : Check all Tables in the current database for following specified naming convention.(Context Only)

SA0061B : Check table names used in CREATE TABLE statements for table name following specified naming convention.(Batch)

SA0062A : Check all Functions in the current database for following specified naming convention.(Context Only)

SA0062B : Check function names used in CREATE FUNCTION statements for following specified naming convention. (Batch)

SA0063A : Check all Views in the current database for following specified naming convention.(Context Only)

SA0063B : Check view names used in CREATE VIEW statements for following specified naming convention. (Batch)

SA0064A : Check all Stored Procedures in the current database for following specified naming convention.(Context Only)

SA0064B : Check stored procedure names used in CREATE PROCEDURE statements for following specified naming convention. (Batch)

SA0065A : Check all Triggers for following specified naming convention.(Context Only)

SA0065B : Check trigger names used in CREATE TRIGGER statements for following specified naming convention. (Batch)

SA0066A : Check all Columns for following specified naming convention.(Context Only)

SA0067A : Check all Unique Key Constraints in the current database for following specified naming convention.(Context Only)

SA0068A : Check all Check Constraints in the current database for following specified naming convention.(Context Only)

SA0069A : Check all Default Constraints in the current database for following specified naming convention.(Context Only)

SA0070A : Check all Primary Key Constraints in the current database for following specified naming convention.(Context Only)

SA0071A : Check all Foreign Key Constraints in the current database for following specified naming convention.(Context Only)

SA0072A : Check all Non-Key Indexes in the current database for following specified naming convention.(Context Only)

SA0073A : Check all User-Defined Types in the current database for following specified naming convention.(Context Only)

SA0074A : Check all Schema-s in the current database for following specified naming convention.(Context Only)

SA0075 : Avoid constraints created with system generated name

SA0076 : Check UPDATE and DELETE statements for not filtering using all columns of the table's PRIMARY KEY or UNIQE KEY

SA0077 : Avoid executing dynamic code using EXECUTE statement

SA0078 : Statement is not terminated with semicolon

SA0079 : Avoid using column numbers in ORDER BY clause

SA0080 : Do not use VARCHAR or NVARCHAR data types without specifying length

SA0081 : Do not use DECIMAL or NUMERIC data types without specifying precision and scale

SA0082 : Consider prefixing column names with table name or table alias

SA0083 : Consider proactively checking the logical and physical integrity of all the objects in the database

SA0084 : Data purity check is not enabled for the current database

SA0085 : Check database objects for missing specific extended properties

SA0086 : Avoid storing database backups on the same volume as the database's data files

SA0087 : Database has suspect pages and needs to be checked

SA0088 : The last full backup for the database cannot be found on the location where it was initially created

SA0089 : The option has a not recommended value SET which will cause the stored procedure to be recompiled

SA0090 : SQL Server password policy is vulnerable for login

SA0091 : Setting the QUOTED_IDENTIFIERS or ANSI_NULLS options inside stored procedure, trigger or function will have no effect

SA0092 : The SQL module was created with ANSI_NULLS and/or QUOTED_IDENTIFIER options set to OFF

SA0092B : The SQL module was created with ANSI_NULLS and/or QUOTED_IDENTIFIER options set to OFF

SA0093 : The compatibility mode of the database is lower than the SQL Server version default compatibility level

SA0094 : Authentication set to Mixed Mode

SA0095 : The updated column is a primary key column

SA0096 : The collation of the current database does not match that of the model database

SA0097 : The procedure/function/trigger has cyclomatic complexity above the threshold value

SA0098 : The results from triggers are currently allowed. Consider disabling results from triggers

SA0099 : The Database is using Full Recovery Model, but its last transaction log backup is too old

SA0100 : Database backups are outdated

SA0101 : Avoid using Hints to force a particular behavior

SA0102 : Do not use DISTINCT keyword in aggregate functions

SA0103 : Avoid using ISNUMERIC function as it accepts floating point and monetary number

SA0104 : Use CASE statements in conjunction with aggregation to write more robust and better performing queries

SA0105 : Avoid using CHARINDEX function

SA0106 : Avoid OR operator in queries

SA0107 : Avoid using procedural logic with a cursor

SA0108 : Avoid using NOLOCK hint, use isolation levels instead

SA0109 : Avoid joining with subquery which has a TOP clause

SA0110 : Avoid have stored procedure that contains IF statements

SA0111 : Do not use WAITFOR DELAY/TIME statement in stored procedures, functions, and triggers

SA0112A : Avoid IDENTITY columns unless you are aware of their limitations

SA0112B : Avoid IDENTITY columns unless you are aware of their limitations

SA0113 : Do not use SET ROWCOUNT to restrict the number of rows

SA0114 : Duplicate names of objects found

SA0114B : Object with the same name but different type already exists

SA0115 : Ensure variable assignment from SELECT with no rows

SA0116 : Consider using EXISTS,IN or JOIN when usage of = (SELECT * FROM ) and the subquery returns more than column

SA0117 : Use OUTPUT instead of SCOPE_IDENTITY() or @@IDENTITY

SA0118 : Use MERGE instead of INSERT...UPDATE or UPDATE...INSERT statements

SA0119 : Consider aliasing all table sources in the query

SA0120 : Consider using NOT EXISTS,EXCEPT or LEFT JOIN instead of the NOT IN predicate with a subquery

SA0121 : Output parameter is not populated in all code paths

SA0122 : Use ISNULL(Column,Default value) on nullable columns in expressions

SA0123 : Consider replacing the OUTER JOIN with EXISTS

SA0124 : Columns in COALESCE are not all the same data type

SA0125 : Avoid use of the SELECT INTO syntax

SA0126 : Operator combines two different types will cause implicit conversion

SA0127 : Avoid wrapping filtering columns within a function in the WHERE clause or JOIN clause

SA0128 : Avoid using correlated subqueries. Consider using JOIN instead

SA0129 : Use WITH EXECUTE AS clause for stored procedures executing dynamic SQL

SA0130 : Explicit error handling for statements between BEGIN TRAN and COMMIT/ROLLBACK TRAN is required

SA0131 : High number of estimated rows found in execution plan

SA0132 : The arguments of the ISNULL function are not of the same data type

SA0133 : Consider storing the result of the Date-Time function which get current time in a variable at the beginning of the statement and use these variable later

SA0134 : Do not interleave DML with DDL statements. Group DDL statemnts at the begining of procedures followed by DML statements

SA0135 : Found filtering columns wrapped inside User-Defined Function call

SA0136 : Use fully qualified object names in SELECT, UPDATE, DELETE, MERGE and EXECUTE statements

SA0141 : Database is using Simple Recovery Model

SA0142 : Consider disabling CLR if user assemblies are not used in your environment

SA0143 : Single use Ad-hoc plans are using considerable amount of the procedure cache

SA0144 : The code will never be executed

SA0145 : The EOL marker sequence is not the expected {CR}{LF}

SA0146 : The RAISERROR statement with severity above 18 and requires WITH LOG clause

SA0147 : The DML statement has complexity above the threshold

SA0148 : Consider using a temporary table instead of a table variable

SA0149 : Consider using RECOMPILE query hint instead of WITH RECOMPILE option

SA0150 : The procedure grants itself permissions. Possible missing GO command

SA0151 : Statements appear after procedures main BEGIN/END block. Possible missing GO command

SA0152 : THROW statement appears as a transaction name in ROLLBACK TRANSACTION

SA0153 : Always specify parameter names when calling stored procedures

SA0154 : Constraint is not trusted

SA0154B : Constraint not checked and left not trusted

SA0155 : Deprecated setting of database option CONCAT_NULL_YIELDS_NULL to OFF

SA0155B : Setting CONCAT_NULL_YIELDS_NULL to OFF is deprecated

SA0156 : Statements CREATE/DROP DEFAULT are deprecated. Use DEFAULT keyword in CREATE/ALTER TABLE

SA0157 : Usage of three and four part column names is deprecated. Two-part names is the standard-compliant behavior

SA0158 : Deprecated usage of space as separator for table hints. Use a comma instead of space

SA0159 : Deprecated use of object name containing only # characters

SA0160 : Deprecated use of @, @@, or names that begin with @@ as Transact-SQL identifiers

SA0161 : The compatibility views are deprecated. It is recommended to use catalog views instead

SA0162 : Column created with option ANSI_PADDING set to OFF

SA0163 : Deprecated setting of database options ANSI_PADDING to OFF

SA0163B : Setting ANSI_PADDING to OFF is deprecated

SA0164 : Consider adding WITH(NEXPAND) when querying an indexed view in order to enable query optimizer use view's index

See Also