Bugs
Introduction
Section titled “Introduction”This analysis group contains rules that represents something wrong in the code that needs to be fixed
Related Topics
Section titled “Related Topics”EX0010 : Identify missing indexes using dynamic management views information
EX0011 : Identify inefficient indexes using dynamic management views information
EX0013 : Identify fragmented indexes that need rebuilding or re-indexing
EX0018 : Analyze execution plan and check for high cost operations
EX0025 : Compressed column used without decompression or updated/inserted without compression
EX0026 : Error found during the query binding phase
SA0003 : Variable used but not previously assigned
SA0007 : Pattern starting with ‘%’ in LIKE predicate
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
SA0021 : Deprecated usage of table hints without WITH keyword
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 : Function call can be extracted from the WHERE clause to avoid unnecessary table scan
SA0030 : Output parameter never assigned
SA0031 : Avoid GOTO statement to improve readability
SA0032 : Avoid using NOT IN predicate in the WHERE clause
SA0035 : TODO,HACK or UNDONE phrase found in a comment
SA0036 : DELETE statement without row limiting conditions
SA0037 : UPDATE statement without row limiting conditions
SA0041 : Avoid joining with views
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
SA0053B : Don’t use deprecated TEXT,NTEXT and IMAGE data types
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
SA0075 : Avoid constraints created with system generated name
SA0075B : Avoid adding constraints with default system generated name
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
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
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
SA0095 : The updated column is a primary key column
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
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
SA0117 : Use OUTPUT instead of SCOPE_IDENTITY() or @@IDENTITY
SA0118 : Use MERGE instead of INSERT…UPDATE or UPDATE…INSERT statements
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 : The arguments for the COALESCE function must be of the same data type
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
SA0131 : High number of estimated rows found in execution plan
SA0132 : The arguments of the ISNULL function are not of the same data type
SA0135 : Found filtering columns wrapped inside User-Defined Function call
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
SA0146 : The RAISERROR statement with severity above 18 and requires WITH LOG clause
SA0147 : The Cognitive Complexity of the statement should not be too high
SA0148 : Consider using a temporary table instead of a table variable
SA0152 : THROW statement appears as a transaction name in ROLLBACK TRANSACTION
SA0154 : Constraint is not trusted
SA0154B : Constraint not checked and left not trusted
SA0158 : Deprecated usage of space as separator for table hints. Use a comma instead of space
SA0160 : Deprecated use of @, @@, or names that begin with @@ as Transact-SQL identifiers
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
SA0168 : Possible division by zero not handled according the practice
SA0169 : Use @@ROWCOUNT only after SELECT, INSERT, UPDATE, DELETE or MERGE statements
SA0178 : LIKE operator is used without wildcards
SA0186 : Possible missing BEGIN..END block
SA0189 : Store procedure executed without getting a result
SA0190 : Numbered stored procedures are deprecated
SA0192 : Procedure returns more than one result set
SA0195 : Duplicate statistics must be removed
SA0196 : Deprecated use of DROP INDEX with two-part index name syntax
SA0197 : The deprecated FASTFIRSTROW hint was encountered
SA0198 : Usage of deprecated GROUP BY ALL syntax encountered
SA0199 : Usage of deprecated COMPUTE clause encountered
SA0200 : Backup to tape syntax is deprecated
SA0201 : Textpointers statements WRITETEXT, UPDATETEXT and READTEXT are deprecated
SA0202 : The text and image functions TEXTPTR and TEXTVALID are deprecated
SA0203 : A deprecated system function is used
SA0204 : The system catalog view is deprecated and may be removed in a future version of SQL Server
SA0206 : The sp_configure store procedure executed with a deprecated option
SA0207 : Setting ANSI_NULLS to OFF is deprecated
SA0208 : Setting CONCAT_NULL_YIELDS_NULL to OFF is deprecated
SA0209 : SET OFFSETS is deprecated
SA0210 : Setting FMTONLY option is deprecated
SA0211 : Setting REMOTE_PROC_TRANSACTIONS option is deprecated
SA0212 : The SETUSER is deprecated. It is recommended to use EXECUTE AS instead
SA0213 : The DBCC command is deprecated
SA0215 : The CREATE RULE and DROP RULE statements are deprecated
SA0217 : Usage of GRANT,DENY and REVOKE statement with ALL option is deprecated
SA0218 : The ‘::’ function calling syntax is deprecated
SA0219 : A deprecated build-in function is used
SA0220 : Creating backups with PASSWORD or MEDIAPASSWORD option is deprecated
SA0221 : The FOR SOAP option in CREATE/ALTER ENDPOINT statement is deprecated
SA0222 : The ALTER LOGIN WITH SET CREDENTIAL or ALTER LOGIN WITH NO CREDENTIAL syntax is deprecated
SA0223 : The MODIFY FILEGROUP READONLY and READWRITE syntax is deprecated
SA0224 : The hint is deprecated for use on tables that are targets of INSERT statement
SA0226 : The usage of ROWGUIDCOL and IDENTITYCOL as column name in DML statements is deprecated
SA0227 : The TIMESTAMP syntax is deprecated, use ROWVERSION instead
SA0228 : WITHIN is now a reserved keyword. References to objects or columns named ‘within’ will fail
SA0237 : Ordering of the result set before inserting it into a table is pointless
SA0238 : The user-defined function appearing in the query filter can cause performance problems
SA0239 : Setting the FORCEPLAN option to ON is not recommended
SA0240 : The stored procedure does not return result code
SA0242 : COUNT aggregate function used instead of EXISTS
SA0243 : Avoid INSERT-EXECUTE in stored procedures
SA0245 : Do not use ORDER BY to order the result set in view or inline table-valued function
SA0246 : Stored procedure executed with incorrect arguments
SA0247A : Don’t use FLOAT, REAL, MONEY, SMALLMONEY or SQL_VARIANT data types
SA0247B : Don’t use FLOAT, REAL, MONEY, SMALLMONEY or SQL_VARIANT data types
SA0251 : Subquery used in expression not ensured to return a single value
SA0252 : The referenced object (table, view, procedure or function) is in another database
SA0253 : The current database is hardcoded in object reference
SA0254 : Invalid operation due to cursor closed or not declared
SA0256 : A cursor with the same name is declared earlier. Avoid reusing cursor names
SA0257 : The cursor declaration does not fit the performed cursor operations
SA0259 : The created object already exists
SA0260 : Parameter defined as nullable, but no default value provided
SA0263 : Temporary table is used before it has any data inserted
SA0265 : COMMIT statement without corresponding BEGIN TRANSACTION statement
SA0266 : ROLLBACK statement without corresponding BEGIN TRANSACTION statement
SA0267 : Table variable is used before it has any data inserted
SA0268 : Table variable is not used as table source
SA0270 : A filtered index created with the IS NULL predicate is not used in SQL Server