Change Default Value for Select Top n and Edit Top n Rows in SSMS

Problem

While looking through the features in SQL Server 2008 Management Studio (SSMS), I noticed that SSMS only shows the Top 1000 rows when selecting data and the Top 200 rows when editing data for a table. In SQL Server 2005 you used to be able to open the entire table, but this option no longer exists. In this tip we will take a look at how to change the default values for Select Top n Rows and Edit Top n Rows in SQL Server 2008 Management Studio.

Solution

In the previous version of SQL Server Management Studio you might have noticed that there was an option to Open Table by right clicking on the table to view all the records within the table. The disadvantage of using the Open Table option of SQL Server 2005 Management Studio was that SSMS used to hang or become unresponsive for a long period of time if you happened to open a large table.

In SQL Server 2008 Management Studio, by default you can only Select Top 1000 Rows or Edit Top 200 Rows for a table as shown in the below snippet.

in sql server 2008 management studio you can only select the top 100 rows

The default option as shown above is to Select Top 100 Rows or Edit Top 200 Rows. This can be changed by following these steps.

1. In SQL Server Management Studio, under Tools, click Options as shown in the snippet below.

in ssms under tools, click options

2. In the Options dialog box, expand SQL Server Object Explorer and then select the Commands tab as shown in the snippet below. Change the Value for Edit Top Rows command and/or Value for Select Top Rows command to a suitable value as per your needs as shown in the below snippet and then click OK.

expand sql server object explorer

3. Once you have saved the changes go ahead and right click on a table to see the changes as shown below.

sql server 2008

Next Steps

Leave a Reply

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