DF070: Not aliased table sources are used in the query.
Last modified: June 12, 2025
The topic describes the DF070 T-SQL code analysis rule.
Category
BEST PRACTICE
Message
Not aliased table sources are used in the query.
Description
Always use aliases for table sources in queries to improve readability and avoid ambiguity, especially in complex queries or joins.
Additional information
Aliasing table sources in T-SQL means assigning a short name (alias) to a table or view referenced in a query. This practice helps make complex queries easier to read and maintain, especially when working with multiple tables or when the same table appears more than once (as in self-joins or subqueries).
Noncompliant code example
-- it is not clear to which table column belongs
SELECT name, code
FROM dbo.Parent INNER JOIN dbo.Child ON Id = ParentId
GO
Compliant solution
SELECT p.name, c.code
FROM dbo.Parent p INNER JOIN dbo.Child c ON p.Id = c.ParentId
GO
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.