Rotating Header Image

Select or Edit Top x Rows

So a little SQL Server Management Studio tip/trick for today (inspired by a user question… Thanks Brandon!!)

When you right click on a table you’re given the options to Select Top 1000 rows or Edit Top 200 rows as shown below:

If you choose to SELECT, SQL Server Management Studio will build your SELECT statement for you and execute it (which is nice cause it populates all your coumn names in your query). 

If you choose to EDIT, SQL Server Management Studio will populate a datasheet for you and allow you to make changes there (if your permissions allow you to do so).

But what if I wanted to SELECT the top 2000 or 5000 rows?  What if I wanted to UPDATE the top 1000 rows?

These values (TOP X) are configurable in SQL Server Management Studio but it is a bit “hidden” in the options menu:

Nothing really “ground-breaking” but hopefully it’ll make someones Management Studio experience that much better. 

Enjoy and follow me on Twitter: @ColinStasiuk

Post to Twitter Post to Delicious Post to Digg Post to StumbleUpon

2 Comments

  1. Great tip. Probably not groundbreaking as you say, but probably the most valuable thing I’ll read today.

    Thanks!

  2. Thanks! 🙂 too often I find myself not blogging cause I want to write about something amazing or unheard of when sometimes the best blog posts are just simple and easy.

    have a great day

Leave a Reply

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.