Rotating Header Image

Select Top x Rows… Great…But I Want More (UPDATE)

So in SQL 2008 there is an object explorer command to Select (or edit) top 1000 rows when you right click on a table or view. When you do this a new query window will open, a select (or update) statement is created with the top 1000 rows and the statement is executed. I personally like this alot as when I’m writing stored procedures, etc I find I’m constantly dragging the columns folder into my active window and writing my SELECT statement from that… this definitely helps in my goal to type the least amount possible to accomplish any given task 🙂 .

The number of rows is actually configurable as well. If you go to:

Tools -> Options -> SQL Server Object Explorer -> Commands

you’ll see that you can change the value for both the SELECT and the UPDATE commands. Nice customization option.

Here is my SQL Server 2010 request: Give me checkboxes to do 2 things:

  1. Generate the script in my active query window
  2. Allow me to decide if I want the statement to be executed or not

OK in the whole big scheme of things both of these are pretty minor/nitpicky and I’m probably sounding like that high maintenance girlfriend you dated back in high school but in the use-case I listed above (writing a stored proc and wanting to quickly pump out a select statement) I think it would be pretty slick (if configured) to have it generate my select statement, put it into my active window where my cursor is currently residing, and NOT execute.

Hopefully this functionality isn’t already there and I’m just not looking in the right place LOL

What do you think useful? not? pretty high maintenance/lazy request?



UPDATE:  So a buddy of mine gave me a buzz and reminded me that if you right click on the table or view and choose Script Table As and then choose SELECT TO you can do basically what I was asking for (with a few more mouse clicks but who’s counting hehehe).  If you select To Clipboard you can paste it into your proc while you’re writing it and off you go.  I guess I’ll have to change my request to something along the lines of… Being able to customize which “quick options” get displayed when I right click on a particular object… sounds cool… it’s probably already there and I just missed it hehehe 😉  Thanks RK!! 

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

Leave a Reply

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