Limiting the size of the result set

The row_count limit type limits the number of rows returned to the user. A limit violation occurs when the number of rows returned by a select statement exceeds the limit value.

If the resource limit issues a warning as its action, and a query exceeds the row limit, the full number of rows are returned, followed by a warning that indicates the limit value; for example:

Row count exceeded limit of 50.

If the resource limit’s action aborts the query batch or transaction or kills the session, and a query exceeds the row limit, only the limited number of rows are returned and the query batch, transaction, or session aborts. Adaptive Server displays a message like the following:

Row count exceeded limit of 50.
Transaction has been aborted.

The row_count limit type applies to all select statements at execution time. You cannot limit an estimated number of rows returned at pre-execution time.