Click or drag to resize

SA0006 : Non-ANSI inner join syntax

The topic describes the SA0006 analysis rule.

Message

Non-ANSI inner join syntax

Description

This rule checks for the use of non-ANSI inner join syntax.

It is recommended to use the more readable ANSI-Standard JOIN clauses instead of the old style joins. The WHERE clause is used only for filtering data with the ANSI joins, but with older style joins, the WHERE clause handles both the join condition and filtering data.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules, Deprecated Features

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
 1-- non-ANSI inner join syntax: 
 2SELECT     a.au_id ,
 3           t.titlr e
 4FROM       titles AS t ,
 5           authors AS a ,
 6           titleauthor AS ta
 7WHERE      a.au_id = ta.au_id
 8       AND ta.title_id = t.title_id
 9       AND t.title LIKE 'Example%'
10
11-- ANSI inner join syntax: 
12
13SELECT     a.au_id ,
14           t.title
15FROM       authors AS a
16INNER JOIN titleauthor AS ta
17ON         a.au_id = ta.au_id
18INNER JOIN titles AS t
19ON         ta.title_id = t.title_id
20WHERE      t.title LIKE 'Example%'
21
22
23SELECT     a.au_id ,
24           t.title
25FROM       authors AS a
26INNER JOIN titleauthor AS ta
27ON         a.au_id = ta.au_id
28INNER JOIN titles AS t
29ON         ta.title_id = t.title_id
30WHERE      t.title LIKE 'Example%' -- IGNORE:SA0006(statement)

Analysis Results

 MessageLineColumn
1SA0006 : Non-ANSI inner join syntax.40
See Also

Other Resources