Is there any property on SQL Server that is similar to Oracle's automatic constraint?

There are a lot of notes on my desk. Sometimes I may forget to use the top keyword when querying, so after that it can be very annoying to wait so long. Oracle uses 500 records unless you use the limit keyword. Is there any property or secret thing (wow!) On sql similar to Oracle outsourcing?

+4
source share
1 answer

You can use rowcount :

 SET rowcount 500 

SET ROWCOUNT overrides the TOP SELECT keyword if rowcount is a lower value.

SET ROWCOUNT is ignored in the INSERT, UPDATE, and DELETE statements when the explicit expression TOP is used in the same expression. This includes instructions in which an INSERT is followed by a SELECT clause.

SET ROWCOUNT is set at the time of execution or start, and not at the time of parsing.


To disable this option so that all rows are returned, specify SET ROWCOUNT 0 .

For more information, check here !

+4
source

Source: https://habr.com/ru/post/1391243/


All Articles