Snippets not saved by the Snippet Manager in SQL Prompt 10 (latest version)

I created a snippet in the Snippet Manager, providing a snippet, description, and code and clicking SAVE.  After doing so, the snippet didn't show in the available list of snippets.  I did it multiple times repeating it and each time it seemed to save ok, but the snippet wasn't showing. I checked the snippet folder and the json file wasn't there.  I then copied another JSON file, edited it, gave it a new GUID inside and out and created the snippet I was trying to save in the snippet manager via JSON instead, saved the file, and then I was able to use my snippet in SQL Prompt.  Why would the Snippet Manager fail to create the JSON file when there are no conflicts in the snippet name and no errors in the UI when hitting save?  Some of the snippets I created a few days ago were in the folder but it seemed like a few were missing besides the one I had to repeatedly try to create and it kept failing.  

Answers

  • eisaacseisaacs Posts: 6 New member
    I'm using the latest version of SQL Prompt: 10.11.9.27382
  • Hi @eisaacs

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

    If you could please answer the following initial questions, that would be greatly appreciated:

    - Has this behavior  only started happening since you updated to the latest version of SQL Prompt (10.11.9)?
    - Does this only happen when you are using specific code within the snippet?, or does it happen with any snippet you try to create?
    - When you initially save a snippet does it show in the list? Does it disappear only after you close and re-open the SQL Prompt options box?
    - Is your snippets folder saved locally, or on a shared location?



    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • eisaacseisaacs Posts: 6 New member
    I have been a user of SQL Prompt for years, but this was a new install of it at a different employer and it was the original install (never updated.)

    I was able to save a more simple example just now, so it seems that it only happens some of the time.

    When I attempted the problem snippet, it kept looking like it worked in the Snippet Manager UI, but wouldn't show in the list.  I checked the files in the folder and the Snippet JSON file was not created.

    I eventually just manually created the JSON file and then it appeared in the list immediately and worked correctly.

    The Snippet folder is the default local location.  It isn't a permissions issue since I was able to save the file manually.

    I'm wondering if it's something specific within my snippet that caused it.  

    I'm able to successfully edit the problem snippet though.

    I deleted it and successfully recreated it too just now.

    I created a bunch the first day I used it and it seems that a few are missing that I expected to have been there.  

    I'm at a loss currently as to what could have caused it.  I just know it didn't get completed the first time I tried.  When I attempted to use it the first time a few days later, I realized it wasn't in my list.  I then tried multiple times to create the Snippet, each time the Snippet Manager seemed to work, but each time the JSON file wasn't written.  So I confirmed the issue was with the Snippet Manager writing the JSON file, but I can't repeat it now.  I could repeat it multiple times that day though.


  • eisaacseisaacs Posts: 6 New member
    New clue:  After I deleted and recreated the snippet earlier today, the snippet was present.  Now a few hours later, the snippet is no longer in the snippet folder and not listed anymore.  It seems something is causing them to be removed after they're saved. 

    The snippet folder is located in : C:\Users\(MyUserName)\AppData\Local\Red Gate\SQL Prompt 10\Snippets.  The only snippets I have in the folder were the original snippets plus 6 I created 30 minutes after installing based on the Date Modified.  It seems I'm missing all the snippets created after that point.  This is bizarre.




  • eisaacseisaacs Posts: 6 New member
    I just recreated the missing "stwh" snippet again tonight and the snippet shows in the list, but the JSON file was not created, or it's already been removed.  The snippet is showing in SQL Prompt and it's working, but the JSON file hasn't been created.  I'm able to use the snippet currently, but I'm skeptical that I will be later.  I think the point of failure is that the JSON files are not always written.


  • eisaacseisaacs Posts: 6 New member
    The JSON file is there now the date stamp says it was created at 11:57pm (well after my print screens above.)  Why would the JSON file not be written immediately?  It seems that the delay might be related. 
  • Hi @eisaacs

    Thank you for all your updates on this! My apology for the delay in coming back to you.

    This behavior is very strange, I'm confused at to why the JSON files wouldn't be written immediately, or that they're being deleted automatically. Clearly this shouldn't be happening.

    I have been trying to replicate what you are seeing here with multiple snippets, however so far the JSON files are written immediately after I save them in Snippet Manager, and non have been deleted.

    I'm a little stumped as to why you are seeing this issue and so I am going to engage with our development team to get their input on this. In the mean time, if you haven't done so already, would it be possible for you to update to the latest version of SQL Prompt (v.10.11.11 - https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.11.11.27632.exe) to see if you continue to see this issue?


    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • In addition to updating SQL Prompt, would it be possible for you enable Verbose logging (SQL Prompt menu > Help > Enable Verbose logging), then try to recreate the issue and provide the resulting log file? 
    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
Sign In or Register to comment.