Options

SQL Prompt 6.3 "Select in Object Explorer" and other issues

kondrichkondrich Posts: 80 Bronze 2
edited February 28, 2014 7:37AM in SQL Prompt
Hi Aaron,

thank you for SQL Prompt 6.3 with this awesome new feature "Select in Object Explorer". We will love it!

Here are my experiences with 6.3.0.39 (yes, I am aware that this is the first build, so no complaints, just a list of issues I encountered):

CTRL+F12 on tables, procedures, views, even their columns(!) works as expected - if the object resides on the same instance on which the script windows is opened.
CTRL+F12 (or choosing the menu option) on synonyms does nothing.
CTRL+SHIFT+F12 on synonyms correctly jumps to the synonym in Object Explorer.
CTRL+F12 on tables, procedures, views that reside on a different instance as the instance where the script windows is open (e.g. SELECT * FROM Server1.Database.owner.table) is a little bit awkward: SQL Prompt jumps to the Server Objects/Linked Servers/Server1/Catalogs/Database tree branch in Object Explorer rather than selecting the object on its hosting server instance/databse itself. Hence, no further object details are available through linked server view.

Highlighting matching parentheses is great!

I am very looking forward for this new version. Thanks!
Regards, Klaus

Comments

  • Options
    Aaron LAaron L Posts: 596 New member
    Thanks for the feedback!

    For the synonyms are they located on a different instance? If they are the same instance but a different database it might help to check the option under Suggestions->Connections->Load referenced databases?

    Going to the connected instance if there is one rather than the linked servers folder definitely makes sense to me. It's a little trickier to resolve than the rest but we'll look into it.
  • Options
    kondrichkondrich Posts: 80 Bronze 2
    Hi,

    load referenced databases was disabled. However, I know that it was enabled before upgrading to 6.3, since we use synonyms everywhere and we really need this.
    OK, I re-enabled it.

    Now it looks a little bit weird: It's working now with CTRL-F12. That's the good news, but only when writing
    SELECT * FROM ObjectAsSynonym|
    
    (where the pipe should explain the cursor position) or if the object name is selected by double-clicking it.
    When writing
    SELECT * FROM ObjectAsSynonym|;
    
    CTRL+F12 does not jump to the object - only if its name is selected in this case. (I customized my ssf snippet to include the trailing semicolon.)
    Regards, Klaus
  • Options
    Aaron LAaron L Posts: 596 New member
    Looks like we're trying to use the semicolon as the "object" to jump to which clearly isn't very useful.

    Good catch!
  • Options
    kondrichkondrich Posts: 80 Bronze 2
    Confirming that this issue is resolved in 6.3.0.65.
    However, on the way to 6.3.0.65 (maybe already during install of the initial 6.3 build), my custom aliases and prefix exclusions got deleted. :-(
    Regards, Klaus
  • Options
    Aaron LAaron L Posts: 596 New member
    Sorry about that, looks like the first 6.3 beta switched which file to store the options in (probably why your "Load referenced databases" option became unticked)

    I just uploaded another build and hopefully your aliases should be back?
  • Options
    kondrichkondrich Posts: 80 Bronze 2
    Yes, 6.3.0.66 fixes the alias issue. Thank you, Aaron!
    Regards, Klaus
  • Options
    kondrichkondrich Posts: 80 Bronze 2
    Aaron,

    I found two issues using 6.3 builds up to 6.3.0.102 if ssf snippet includes a trailing semicolon:
    SELECT *
    FROM $CURSOR$;
    
    If I open a single/double quotation mark or a parenthesis directly before the semicolon, SQL Prompt does not insert the closing one automatically. This leads to the following code:
    SELECT *
    FROM dbo.Table
    WHERE Column = (|;
    
    (As always, the pipe indicates the cursor position.)
    Instead of:
    SELECT *
    FROM dbo.Table
    WHERE Column = (|);
    

    And if we continue our little example using a subquery and a second ssf in it, it generates:
    SELECT *
    FROM dbo.Table
    WHERE Column = (SELECT *
                               FROM |;;
    
    Now the closing parenthesis is missing and there are two semicolons at the end of the statement.
    Regards, Klaus
  • Options
    Aaron LAaron L Posts: 596 New member
    Hi Klaus,
    It looks like it's always been this way (I just gave it a go in prompt 5) I'll log a bug for the closing characters as it feels like it should be inserting one here. However with your second example I'm not sure it would help here since you'd end up with something like:
    SELECT * 
    FROM dbo.Table 
    WHERE Column = (SELECT * 
                               FROM |;);
    

    I'm wondering if adding semicolons to snippets might not be the best approach here. I noticed you voted on https://redgate.uservoice.com/forums/94 ... semicolons which I guess would be a better solution for you?
  • Options
    kondrichkondrich Posts: 80 Bronze 2
    Hi Aaron,

    it would definitely be better, if SQL Prompt handled the semicolon itself. Customizing the snippets is just a (hopefully: temporary) workaround.
    Regards, Klaus
  • Options
    Aaron LAaron L Posts: 596 New member
    Hi Klaus,
    The latest beta (6.3.0.188) should now try to select a linked server object on a connected server rather than looking under the "Server Objects/Linked Servers" folder (although it'll fall back to this if you haven't got an open connection to that server)
  • Options
    kondrichkondrich Posts: 80 Bronze 2
    Oh yes. Thanks for this note and the implementation. I did not realize this yet.
    Regards, Klaus
Sign In or Register to comment.