BUG: Inserted Code -> Special Characters malfunctioning?
scollis
Posts: 32 Bronze 3
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
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
Which version of SQL Prompt are you using? Would you be able to provide an example of where Prompt gets this wrong?
Cheers
Harry
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.
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