What are the challenges you face when working across database platforms? Take the survey

Single-quote handling changed??


I noticed an oddity with SQLPrompt that I am pretty sure was not there before. This might be related to my upgrade to SSMS 17.3, as that is the only thing I recently changed.

Based on my preference settings, when I type
, SQLPrompt will provide a closing parenthesis as I type the open parenthesis; if I then still type it myself if will recognise I typed the character I provided and simply skip past it. The result is the code I intended.

However, when I type
, I *used* to get the same behaviour for the single-quote marks. As I type the first, SQL Prompt automatically provides a closing quotemark; as I then type another single-quote mark it USED TO skip past it and leave me with the intended SQL.

But not anymore. Now, what I see is that I still get a second quotemark as I type the first, but when I type the second it will simply be inserted. So now, when I type
with SQLPrompt enabled, the result looks like
SELECT 'a';'
and it will throw an error when I execute it.

I have now changed the options to no longer automatically add the closing single-quote-mark, so I will no longer be burned by this, but it would be nice to be able to turn that option back on after this bug is fixed.
Hugo Kornelis
(SQL Server MVP, 2006-2016 + 2019-now // Friend of Red Gate)

Best Answer

  • Options
    krzysztofkroczakkrzysztofkroczak Posts: 55 Silver 2
    Hi @HugoKornelis,

    Sorry for your inconvenience.
    I tried to reproduce it, but I couldn't. I tried to do it on SSMS2016 and SSMS17.3.
    Could you provide more info about SSMS environment? Is it still a problem? Is it a just first run problem?
    Have you seen anything specific in logs?
    Do you have any other extensions which could break normal behaviour?

    Best regards,


  • Options
    Hi Krzysztof,

    After reading your message I tried if I can still reproduce it. I re-enabled the option to add a closing single-quote mark and tried what happens. And it does work as intended (and as it did previously) for me.

    So I don't know if this wa a one-time thing, or if it is a sporadic on-and-off thing. I'll leave the option on and I'll let you know if it returns.

    I don't know which logs I should check for this or where to find them. The only other SSMS extension I have is the SQL Sentry Plan Explorer plug-in, and I've been using that "forever".

    Thanks for your reply. For now, you can probably consider this as fixed.

    Hugo Kornelis
    (SQL Server MVP, 2006-2016 + 2019-now // Friend of Red Gate)
Sign In or Register to comment.