Home

SQL JOIN conditions should involve all joined tables

Rule description

  • SQL JOIN conditions should involve all joined tables

 

Non-compliant Code Example

SELECT p.Name AS ProductName, pv.Name AS VendorName 
FROM Production.Product p, Purchasing.ProductVendor pv;         --Non compliant code (SQL JOIN conditions not involve all joined tables)

Compliant Code Example

SELECT p.Name AS ProductName, pv.Name AS VendorName 
FROM Production.Product p, Purchasing.ProductVendor pv
Where p.Id = pv.Product_Id;         --Compliant code (SQL JOIN conditions is involve all joined tables)
Visual Expert 2020
 VEPLSQLRULE33