If you use SQL Server Management Studio often, you will have noticed that from the context menu that is displayed when right-clicking on a table, there are two options (among the others) namely Select Top 1000 Rows and Edit Top 200 Rows.
Looking for something else? Try these links instead:
- Script Table Data In SQL Server Management Studio
- Easily Generate Table Change Scripts In SQL Server Management Studio
- Automate Standard Comment Blocks For New SQL Queries
- Prevent Accidental Table Data Deletion In SQL Server Management Studio
- Query Stack Overflow With T-SQL – Give Your Queries A Workout
Choosing Select Top 1000 Rows does not tell SQL Server Management Studio, edit all rows, please. If you need to edit more data than 200 rows, then the SQL Server Management Studio, Edit rows command will not suffice. So how do you tell SQL Server, edit all rows, please?
I’m going to show you exactly how you can use SQL Server Management Studio, edit all rows and get your whole table back allowing you to modify the data?
SQL Server Select all Rows
As mentioned earlier, the standard way of selecting rows is to select only the top 1000 rows.
The good news is that you can change this default selection to whatever you like by following these steps:
- Click on Tools in the menu, and then Options
- Select SQL Server Object Explorer. From the options on the right-hand side, look for
the fields Value for Edit Top <n>Rows Command and
Value for Select Top <n> Rows Command. - Set both these values to 0
You can obviously change the values for each as you wish (for example 2000 for select top 2000 rows), but if you would like to select and edit all the rows, change these values to 0
Selecting all Rows in SSMS
Now if you go back into SSMS and right-click on a table, you will see that the Context Menu options have changed to Select and Edit All Rows.
The idea behind this (for me anyway) is purely from a developer’s perspective. I want to be able to edit and select all the available data.