DF056: Three- or four-part column name is used in a query.

Last modified: May 28, 2025

The topic describes the DF056 T-SQL code analysis rule.

Category

DEPRECATED

Message

Three- or four-part column name is used in a query.

Description

It is recommended to use the standard-compliant two-part column names. To reference a column, only the table name or alias is necessary.

Additional information

Following this rule enhances code readability and reduces ambiguity, making it easier to understand and maintain SQL queries. Additionally, adhering to standard-compliant naming conventions ensures compatibility across different database systems and minimizes potential issues when migrating or sharing code between platforms. By consistently using two-part column names, you promote consistency and clarity in your SQL code, leading to improved maintainability and ease of understanding for developers and administrators.

Noncompliant code example

SELECT sales.Customer.AccountNumber AS CustomerName
FROM sales.Customer
GO

Compliant solution

SELECT c.AccountNumber AS CustomerName
FROM sales.Customer c
GO