Click or drag to resize

EX0019 : Find references to non-existing objects and columns

The topic describes the EX0019 analysis rule.

Message

Find references to non-existing objects and columns

Description

[Beta]The rule checks T-SQL code and reports occurrences of references to non-existing objects and columns.

NOTE: Due to The rule currently being in preview there could be some false positives reported.

Scope

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

Parameters
NameDescriptionDefault Value
IgnoreTemporaryTables

The parameter specifies if to ignore temporary tables not created in current batch.

yes

Remarks

The rule requires SQL Connection. If there is no connection provided, the rule will be skipped during analysis.

Categories

Explicit Rules, New Rules

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
 1SELECT 'Total income is', ((OrderQty * Price) * (1.0 - UnitPriceDiscount)), ' for ',
 2p.Name AS ProductName 
 3FROM Production.Product AS p 
 4INNER JOIN Sales.SalesOrderDetail AS sod
 5ON p.ProductID = sod.ProductID 
 6ORDER BY ProductName ASC;
 7
 8SELECT p.ProductName AS ProductName, 
 9NonDiscountSales = (OrderQty * UnitPrice),
10Discounts = ((OrderQty * UnitPrice) * UnitPriceDiscount)
11FROM Production.Product AS p 
12INNER JOIN Sales.SalesOrderDetail AS sod
13ON p.ProductID = sod.ProductID 
14ORDER BY ProductName DESC;
15GO

Analysis Results

 MessageLineColumn
1EX0019 : Invalid column reference Price.139
See Also

Other Resources