219

In SQL Server 2008 Management Studio, when I right click on a database table and choose Select Top 100 Rows, I can then e.g. easily add a ORDER BY statement to the SQL. That works fine.

But when I do choose Edit Top 200 Rows, I don't have the ability to alter the SQL (which makes it hard to find and edit a record just added in the 10,000 that are there.

I am quite sure I was able to do this in SQL Server 2000.

Is there any way in SMSS 2008 to alter the way the records are displayed when editing records?

8 Answers 8

328

If you right click on any result of "Edit Top 200 Rows" query in SSMS you will see the option "Pane -> SQL". It then shows the SQL Query that was run, which you can edit as you wish.

In SMSS 2012 and 2008, you can use Ctrl+3 to quickly get there.

5
  • 31
    To refresh the results after editing the query, you need to right-click and select Execute SQL (Or use the keyboard shortcut Ctrl+R) May 27, 2016 at 20:18
  • 1
    This answer its even better, it allows you to actually Edit the query SELECT top 500 *** SELECT top 1000 *** WHERE ***
    – Mihai
    Oct 31, 2017 at 13:28
  • 1
    Is it possible to have Pane -> SQL as default when using "Edit top 200 rows"? Jul 3, 2018 at 13:06
  • 1
    Great answer!!--very useful b/c it shows an EDIT grid. afaik it's completely undocumented. (also nowhere else in ssms do you get an edit grid with a composable sql of the rows you want in the edit grid). This shouldn't be so buried in the SSMS gui. (Still works on the latest ssms and sql server 2019.)
    – techvslife
    Mar 21, 2020 at 22:44
  • this is perfect! Late to the game but this is still a really helpful answer
    – pauliec
    Mar 19, 2021 at 13:18
165

You can also change the pop-up options themselves, to be more convenient for your normal use. Summary:

  1. Run the SQL Management Studio Express 2008
  2. Click the Tools -> Options
  3. Select SQL Server Object Explorer . Now you should be able to see the options

    • Value for Edit Top Rows Command
    • Value for Select Top Rows Command
  4. Give the Values 0 here to select/ Edit all the Records

Full Instructions with screenshots are here: http://m-elshazly.blogspot.com/2011/01/sql-server-2008-change-edit-top-200.html

2
  • 2
    Not found m-elshazly.blogspot.com.es/2011/01/…
    – Kiquenet
    Apr 17, 2015 at 8:23
  • 2
    @nag - This is a good answer for permanent changes to the buttons, but sometimes I want to make changes to a small subset of rows while looking at others. The answer by David Hall makes this possible by simply adding Where ID in (1,2,3,4,5) or something similar.
    – Origin
    Feb 6, 2017 at 4:22
33

Very quick and easy visual instructions to change this (and the select top 1000) for 2008 R2 through SSMS GUI

http://bradmarsh.net/index.php/2008/04/21/sql-2008-change-edit-top-200-rows/

Summary:

  • Go to Tools menu -> Options -> SQL Server Object Explorer
  • Expand SQL Server Object Explorer
  • Choose 'Commands'
  • For 'Value for Edit Top Rows' command, specify '0' to edit all rows
1
  • 1
    This is the only option that seemed to work in the SQL Server Management Studio in 2020 Aug 19, 2020 at 21:55
14

enter image description here

Follow the above image to edit rows from 200 to 100,000 Rows

9

Ctrl+3 in SQL Server 2012. Might work in 2008 too

0
7

in SQL 2017 You can do it more easily in the toolbar to the right just hit
enter image description here

the SQL button then its gonna apear the query with the top 200 you edit until the quantity that You want and Execute the query and Done! just Edit

5

Similar to David Hall's response, if you are a non-coder, it may be easiest to right-click within results, then choose Pane > Criteria. This allows you to adjust sort, add filters, etc... without adjusting SQL code.

4

The default to open/add rows to a table is Edit Top 200 Rows. If you have more than 200 rows, like me now, then you need to change the default setting. Here's what I did to change the edit default to 300:

  1. Go to Tools in top nav
  2. Select options, then SQL Service Object Explorer (on left)
  3. On right side of panel, click into the field that contains 200 and change to 300 (or whatever number you wish)
  4. Click OK and voila, you're all set!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.