annoying bug

Hi redgate Team,

there is an annoying bug which makes it hard to use SQL Prompt.

Bug:

1) Create a snippet and call the snippet #JobCategory for example
2) Type GO into SSMS and press enter,
3) SQL Prompt inserts the code for the snippet instead of GO

Fix:
Make sure that you have to type the name of the snippet or at least the first!! characters to insert the snippet. GO is part of #JobCate!go!ry but apart from this there is nothing in common.

Please fix this since once the snippet is inserted you cannot even undo it by pressing CTRL+Z.

Thanks!

Torsten

Answers

  • Dan_JDan_J Posts: 459 Silver 2
    Hi @torsten.strauss

    I'm sorry to hear you are seeing this issue in SQL Prompt! Thanks for reaching out to us on this.

    So far I've not been able to reproduce the issue you are seeing, would it be possible for you to provide the #JobCategory snippet file?


    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • Hi Dan!

    It seems that you first have to enter #J and select the snippets attached. Once SQL Prompt "registered" the snippet it will sugest and insert the content of the snippet everytime you enter GO then.


  • Hi @torsten.strauss

    Many thanks for the further details you have provided on this, and for the snippet file!

    I have used your snippet file to attempt a reproduction of the issue you are seeing, but to be honest I am not see the same problem.

    The steps I have taken are as follows:

    - Open a new SSMS query window
    - Type #J and select the #JobCategory snippet (The contents of the snippet is inputted)
    - Enter down a couple of lines after the snippet contents
    - Type GO and press enter

    For me, the contents of the snippet is not then inputted.

    Please can you confirm if the steps I have outlined above are exactly the same steps you are also taking?

    Also, please can you confirm which versions of SSMS and SQL Prompt you are currently using?



    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • ntyndallntyndall Posts: 1 New member
    Hi Dan,

    I know this post is quite old but I am experiencing the same issues;

    basically if a snippet has a substring of a SQL statement, then once you hit enter (or one of the keys to activate the snippet), then it'll paste it in

    For example, I could write

    LEFT JOIN TABLE1
    ON

    then I have a snippet called Addons (ON is inside Addons) so it shows up as an option, so if I want a new line I hit return, but it enters the snippet..



    Before I go and rename all snippets, is there a workaround? I feel like there should a key that allows you to bring up snippets, for example a "!" key, then once I start typing it should show my snippet list in the tool tip, not when I am typing normal SQL code, otherwise it auto completes every time I try and write a JOIN.

    I can try and create a gif or something if that helps you visualise but hopefully that information is enough?

    Thanks!
Sign In or Register to comment.