Aliases can complicate and hide commands that hamper resiliency

Software ResiliencyCode Reliability

Why you should care

An Alias is an alternative name or reference that can be defined in a T-SQL statement for use within that statement. They are not stored by the SQL server permanently. Usually they are one or two characters long and are not required in any part of the statement. However while they simplify syntax and improve readability, they can also complicate administration and takes a lot of joins in SQL to obtain a complete record which can be an issue in code reliability.

They can also hide commands that can resiliency issues as well

Business Impacts

It is recommended to avoid using an alias as it masks commands which causes potential risks in the code that can lead to productivity issues.

Production Risk
5362

CAST Recommendations

References

http://sqlmag.com/t-sql/aliases-t-sql

Style Guide

How we detect

This code insight focuses on how aliases can hide dangerous or inappropriate commands. Prefer using the native command by specifying explicitly the options you need

5362

About CAST and Highlight’s Code Insights

Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.

See featuresHow it works