SA0119 : Consider aliasing all table sources in the query | ![]() |
The topic describes the SA0119 analysis rule.
Consider aliasing all table sources in the query
The rule alerts for not aliased table sources in the FROM clause of SELECT, UPADTE and DELETE statements.
Consider aliasing all table sources in the query.
The rule has a Batch scope and is applied only on the SQL script.
Name | Description | Default Value |
---|---|---|
IgnoreSingleTableSources | The queries accessing single tables will be ignored. | yes |
IgnoreTableValuesFunctions | The not aliased table valued functions will be ignored. | yes |
IgnoreSystemObjects | The not aliased system tables or views will be ignored. | yes |
The rule does not need Analysis Context or SQL Connection.
Design Rules
There is no additional info for this rule.
1SELECT * 2FROM Sales.Customer 3INNER JOIN Sales.vStoreWithAddresses AS sa 4 ON CustomerID = sa.BusinessEntityID 5WHERE TerritoryID = 5 6 7SELECT * 8FROM Sales.Customer /*IGNORE:SA0119*/ 9INNER JOIN Sales.vStoreWithAddresses AS sa 10 ON CustomerID = sa.BusinessEntityID 11WHERE TerritoryID = 5 12 13SELECT * 14FROM HumanResources.Employee 15UNION 16SELECT * 17FROM HumanResources.Employee 18OPTION (MERGE UNION); 19 20SELECT * FROM Sales.SalesOrderHeader WITH (NOLOCK)
Message | Line | Column | |
---|---|---|---|
1 | SA0119 : Table source does not have an alias. Consider aliasing all table sources in the query. | 2 | 11 |
© Ubitsoft Ltd. All Rights Reserved.