DF187: Unqualified column name is used in the SELECT list.

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

Category

BEST PRACTICE

Message

Unqualified column name is used in the SELECT list.

Description

It is recommended to fully specify column names with aliases to prevent ambiguity and improve readability.

Noncompliant code example

SELECT NAME COLLATE Latin1_General_100_BIN
FROM sys.columns
GO
 
SELECT Salary*2
FROM dbo.PersonnelSalary
GO

Compliant solution

SELECT NAME COLLATE Latin1_General_100_BIN AS Name
FROM sys.columns
GO
 
SELECT Salary*2 AS DoubledSalary
FROM dbo.PersonnelSalary
GO

SELECT FirstName /*result column name inherits source column name FirstName*/
FROM dbo.Personnel
GO

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?