DF076: TOP (100) PERCENT is used.

Last modified: June 12, 2025

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

Category

BEST PRACTICE

Message

TOP (100) PERCENT is used.

Description

In recent versions of SQL Server, the TOP (100) PERCENT clause is meaningless and is ignored by the query processor. It is recommended to exclude it from the query.

Additional information

Using TOP (100) PERCENT can create the false impression that query results are limited or ordered, even though it has no functional impact. It may also interfere with query rewrites or view optimization. To keep your code clean and maintainable, avoid using TOP (100) PERCENT unless required for backward compatibility or specific tooling constraints.

Noncompliant code example

SELECT TOP(100) PERCENT c.FirstName, c.LastName
FROM dbo.Customer c
ORDER BY c.Id;
GO

Compliant solution

SELECT c.FirstName, c.LastName
FROM dbo.Customer c
ORDER BY c.Id;
GO