Top tip: Why is my SQL View not being sorted in the InfoPanels?

Last update:
Created :
Written by Thomas Speekenbrink

Overview:

You have made a SQL View to display a list of values, but they are not sorted as shown in the SQL query tool.

Top tip:

The reason: By default your View will get added TOP(100) PERCENT after the SELECT.

SQL View Example :
SELECT TOP (100) PERCENT CasePercentage AS Percentage, Total AS [Total Cases], firstname AS [First Name], lastname AS [Last Name]
FROM dbo.View_TicketOwnerTotals
ORDER BY [Total Cases] DESC

To ensure the sorting takes effect, you need to change the "TOP(100) PERCENT" to "TOP(99999)" in your SQL query tool and the problem will be solved.