Using SSMS to change the Edit TOP Rows option

SQL Server 2008 Management Studio has an option to Edit the Top 200 Rows. Just Right Click on the Table and you get the following options:

image

If your table contains many columns, opening 200 rows to edit them would be slow to execute. However not many know that this number can changed using a simple setting.

So let us say we want to edit only the TOP 5 Rows. A quick way to do this would be to go to Tools > Options > SQL Server Object Explorer and change the ‘Value of Edit Top <n> Rows Command to 5

Now when you Right Click the Table, you see the option to Edit only TOP 5 rows

image

A very simple tip, but known to many!


About The Author

Suprotim Agarwal, MCSD, MCAD, MCDBA, MCSE, is the founder of DotNetCurry, DNC Magazine for Developers, SQLServerCurry and DevCurry. He has also authored a couple of books 51 Recipes using jQuery with ASP.NET Controls and a new one recently at The Absolutely Awesome jQuery CookBook.

Suprotim has received the prestigous Microsoft MVP award for nine times in a row now. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that represents premium web sites and digital publications comprising of Professional web, windows, mobile and cloud developers, technical managers, and architects.

Get in touch with him on Twitter @suprotimagarwal, LinkedIn or befriend him on Facebook

1 comment:

Greg said...

Thanks for this tip. I never knew the option could be changed.

Is there any way I can use this option to return TOP rows based on a condition. For eg: Return TOP 5 Rows where x='some value'?