Maximize the power of SQL Prompt with SQL Toolbelt Essentials. Watch now.

BUG: Inserted Code -> Special Characters malfunctioning?

scollisscollis Posts: 27 Bronze 3
edited August 30, 2016 10:24AM in SQL Prompt
Hi,

I turned off the option to insert closing single quotation marks in Sql Prompt, and this seems to work.

However if I need to turn three quote marks into four (for example), the additional quote mark gets "swallowed" and I still have three.

This isn't a major issue, but it's very annoying, especially when writing scripts that build SQL (which I do surprisingly more often than I thought I would).

Is this a malfunction of SQL Prompt? Or is this a bug in SSMS that Sql Prompt can correct for?

Thanks

Comments

  • Harry FrankishHarry Frankish Posts: 53 New member
    Hi zippy72

    Which version of SQL Prompt are you using? Would you be able to provide an example of where Prompt gets this wrong?

    Cheers
    Harry
  • scollisscollis Posts: 27 Bronze 3
    Hi,

    I can reproduce it in version 7.2.4.291.

    A quick example is to start adding quotes to this line:

    DECLARE @Example uniqueidentifier = {guid'A183E822-FB46-48C4-8673-21C5A61F4EBA'};

    to turn it into

    DECLARE @Example nvarchar(50) = '{guid''A183E822-FB46-48C4-8673-21C5A61F4EBA''}';

    What I did is to start from the right. I added an extra quote in after the last quote and it's fine. However trying to add an addition quote BEFORE the first one after "guid" gets swallowed, whereas the one afterwards doesn't.

    I made a video demonstrating it - email me it if you want to see, or if you need any further clarification.
  • Hi zippy72

    Thanks for your response. We've added an option in SQL Prompt 7.3 (currently in beta here) which will allow you to toggle this behaviour. To stop SQL Prompt 'swallowing' closing characters go to SQL Prompt > Options > Special characters and uncheck "Remove duplicate closing characters as you type".

    Cheers
    Harry
Sign In or Register to comment.