Friday, November 26, 2010

Sql Server Management Studio: Select /Edit Top N Rows

Like many useful enhancements in Sql Server Management Studio 2008, "Select Top N Rows" and "Edit Top N Rows" options are added. Now you can execute select (from your desired table)query by just right click on desired table and click "SELECT TOP 1000 ROWS". Or you can edit top 200 number of row by clicking on "SELECT TOP 200 ROWS".


Question arises, How to change default number of rows i.e. 1000 for select and 200 for edit. Simple:

Select TOOLS from your main menu and click OPTIONS, move cursor to SQL SERVER OBJECT EXPLORER


By changing values for "Value for Edit top rows command" or "Value for Select top rows command", to your desired one, will change your default settings.

Keep in mind that setting value 0 (ZERO) for both options mean ALL TABLE ROWS.

2 comments:

  1. PERFECT! Straight to the point... simple question simple answer.
    Cheers.

    ReplyDelete
  2. Thanks a lot this was very helpful.

    Cheers.
    Balaram

    ReplyDelete

All suggestions are welcome