Click or drag to resize

SA0165 : TOP (100) PERCENT found

The topic describes the SA0165 analysis rule.

Message

TOP (100) PERCENT found

Description

This rule checks for the phrase "TOP (100) PERCENT".

This phrase has no bearing unless the percentage is less than 100.

This phrase is commonly generated by creating a view in the SQL Server View Designer.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules, New Rules

Additional Information

There is no additional info for this rule.

Example Test Script
 1SELECT TOP 99 PERCENT
 2           LastName, FirstName, JobTitle, Department
 3FROM       HumanResources.vEmployeeDepartment
 4ORDER BY LastName ASC
 5
 6SELECT TOP 100 PERCENT
 7           LastName, FirstName, JobTitle, Department
 8FROM       HumanResources.vEmployeeDepartment
 9ORDER BY LastName ASC
10
11SELECT TOP 100 PERCENT
12           LastName, FirstName, JobTitle, Department
13FROM       HumanResources.vEmployeeDepartment
14
15SELECT TOP (100) PERCENT  /*IGNORE:SA0165(LINE)*/
16           LastName, FirstName, JobTitle, Department
17FROM       HumanResources.vEmployeeDepartment
18
19SELECT
20        F.Code, 
21        F.CustNum, 
22        SupplierCode = ((SELECT TOP 100 PERCENT S.SupplierCode FROM Supplier S WHERE S.FacilityCode = F.FacilityCode))
23FROM Facility F;

Analysis Results

 MessageLineColumn
1SA0165 : TOP (100) PERCENT found.67
2SA0165 : TOP (100) PERCENT found.117
3SA0165 : TOP (100) PERCENT found.2225
See Also

Other Resources