Code Analysis

ST001

Old-style join is used (...from table1,table2...) 

Checks the SQL for occurrences of non-ANSI standard joins, using the =* and *= syntax. This form of SQL is no longer used. It is always better to specify the type of join you are using: INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER and CROSS. 

The "old style" Microsoft/Sybase JOIN style for SQL, which uses the =* and *= syntax, has been deprecated. Queries that use this syntax will fail when the database engine level is 10 (SQL Server 2008) or later (compatibility level 100). The ANSI-89 table citation list (FROM tableA, tableB) is still ISO standard for INNER JOINs only.

Neither of these styles are worth using. It is always better to specify the type of join you require, INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER and CROSS, which has been standard since ANSI SQL-92 was published. While you can choose any supported JOIN style, without affecting the query plan used by SQL Server, using the ANSI-standard syntax will make your code easier to understand, more consistent, and portable to other relational database systems.

Read more on the Redgate Hub

Available in

SQL Prompt

SQL Code Guard


Didn't find what you were looking for?