Error Message:

Msg 127, Level 15, State 1, Line 1
A TOP N value may not be negative.

This error occurs when you try to specify negative value for the TOP Clause in the select statement.

Simple Example:
SELECT TOP(-5) * FROM sys.tables

When the above code is executed error message 127 would occur.


Update the TOP clause with a positive value.
SELECT TOP(5) * FROM sys.tables

In the above code -5 is changed to 5.

Leave a Reply

Your email address will not be published. Required fields are marked *