Suggestion: An object picker

robwrobw Posts: 8 New member
edited September 1, 2009 5:29PM in SQL Prompt Previous Versions
I'm new to the Red-Gate tools and forum, so I apologize if this post is redundant or in an inappropriate place.

I use the Eclipse IDE quite a bit, and it has a very handy feature: CTRL-SHIFT-T brings up a prompt where you type a few characters of an object name. Objects matching that pattern appear in a select window. You pick the object, and it is loaded into the editor.

I have a client with many, many stored procedures. Scrolling through the very long list in the object browser in SSMS is tedious. I think that adding an Eclipse-style object picker to the application would be a great benefit to users. Visual Studio itself could also benefit from this, as well.

Comments

  • Hi Rob,

    Many thanks for your post.

    Unless I am missing something here in what you are looking for, that is one of the things that SQL Prompt does.

    Whilst typing out T-SQL, SQL Prompt will automatically provide you with suggested candidates based on what you type. For example, using Adventureworks if you type "EXEC dbo.us" you will automatically be provided with a list of the stored procedures in the database that will narrow down the more characters you type, or you select a candidate from the list.

    If you do not wish for SQL Prompt to be on all the time, you can manually trigger suggestions by hitting CTRL + Space.

    Is this the sort of thing you are looking for Rob?
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • robwrobw Posts: 8 New member
    Peter,
    Thanks for your reply. You are correct in the context of editing SQL. SQL Prompt does this for you when you want to exec another stored procedure, or reference a table, or use a reserved word.

    I'm talking about realizing that you need to open an existing stored procedure for editing. In the Eclipse example, when you hit CTRL-SHIFT-T, a new box opens up. You type a few characters, and matching classes come up. You pick the class, and it opens for editing.

    The reason I ask for this feature is because of client sites that have hundreds of stored procedures. Scrolling down the object browser is time consuming and not very user friendly. Opening up a window to type a few charaters, picking the correct stored procedure, then having it open up as "ALTER PROCEDURE ..." would be a nice feature.

    If you like, I could create a small movie demonstrating the feature in action and send it to you.

    Rob
  • Hi Rob,

    That would be fantastic. If you would like to send it to support(at)redgate.com and mark it for my attention, I will have a look and then raise a feature request for you.

    Pete
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • robw wrote:
    I'm talking about realizing that you need to open an existing stored procedure for editing. In the Eclipse example, when you hit CTRL-SHIFT-T, a new box opens up. You type a few characters, and matching classes come up. You pick the class, and it opens for editing.

    Rob, have you tried out how SQL Prompt works?

    * Open a "New Query" window in SSMS
    * Type "AP" and hit TAB (should auto-complete to "ALTER PROCEDURE")
    * Start typing your procedure name, select from the list and hit TAB
    * SQL Prompt will pull the whole SP in ready for you to modify it.

    I think that is essentially what you are trying to do. (The above assumes you have TAB setup as a completion key.)

    The same works for Views and Functions, other than they don't have a pre-defined AV snippet for "Alter View" for some reason.
  • WOW

    You learn something new every day , the other way to do it is if you are in an sp that calls another sp or fnc , just highlight the Sp name and the dialog opens , copy to clipboard and paste into a new query .

    But beware if the source sp have changed you may get an older version unless you have refeshed the schema
  • robwrobw Posts: 8 New member
    That's exactly what I was looking for. Eclipse uses a prompt window, but the end result is the same thing: The stored procedure you want is in an edit window.

    Thanks!

    Rob
Sign In or Register to comment.