SQL Server: Set ROWCOUNT to return only fix number of rows for all Query Result.

In this post, I am showing one SSMS option to set ROWCOUNT for defining a fix number of return rows by all SQL Query for SQL Server.

If you are aware about MySQL Workbench, it also returns only top 1000 default rows for all query results.

SQL Server SSMS has also this kind option to set default ROWCOUNT of query results.

The main advantages to set this option,
If a table has millions row and someone is executing this without knowing about this, it requires more memory resource to produce results into SSMS.

You can set an option from menu Tools -> Option -> Query Execution -> change value of SET ROWCOUNT.

SQL Server Set Row Count

After setting this parameter, you can execute the SELECT command on any tables and it returns only 10 rows to result grid.

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of