SQL prompt snippets triggering the SSMS template parameter windows

AndyHodgeAndyHodge Posts: 6 Bronze 1
edited July 2, 2020 7:59AM in SQL Prompt
Hi,   I have a snippet that has some XML within it.   When i access the snippet via the tab key, the snippet correctly inserts into the SSMS query window but then the template parameter window appears (same as ctrl shift and M).   Is SQL prompt triggering this or is it some other default in SSMS?   Is there any way to disable this?
Tagged:

Answers

  • AndyHodgeAndyHodge Posts: 6 Bronze 1
    Worked around this by splitting my XML across multiple lines, this stops the template parameter window appearing 
  • Alex BAlex B Posts: 1,158 Diamond 4
    I'm glad you have it sorted!

    Based on https://documentation.red-gate.com/sp/sql-code-snippets/using-ssms-templates-in-sql-prompt-snippets it looks like it may have been SQL Prompt depending on what was in the XML. 

    I had a quick try and this will bring up the popup:
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;"><tag1>I, have, stuff</tag1></span><br>

    But this doesn't:
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;"><tag1>
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;">I, have, stuff
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;"></tag1>
    </span>
    and nor does this:
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;"><tag1>I, have</tag1>
    </span>
    So it seems to interpet any <> with two commas between as a reason to open the parameter template window.
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Alex BAlex B Posts: 1,158 Diamond 4
    Actually, looking at the contents of the parameter template window, SSMS isn't doing any validation either:


    And this happens if you just type the above, so the only thing would be whether the window was opened in certain cases or not and I can check if that's possible.

    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Apologies for the delayed update, this should be fixed as of SQL Prompt 10.3.9, so if you have not already please update to that or a later version and see if it now behaves better for you.
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.