EX0019 : Find references to non-existing objects and columns |
The topic describes the EX0019 analysis rule.
Find references to non-existing objects and columns
[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.
The rule has a Batch scope and is applied only on the SQL script.
Name | Description | Default Value |
---|---|---|
IgnoreTemporaryTables |
The parameter specifies if to ignore temporary tables not created in current batch. |
yes |
The rule requires SQL Connection. If there is no connection provided, the rule will be skipped during analysis.
Explicit Rules
There is no additional info for this rule.
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 |
Message | Line | Column | |
---|---|---|---|
1 | EX0019 : Invalid column reference Price. | 1 | 39 |