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

Why SQL prompt stopped overwriting old snippets?

sumeetsumeet Posts: 4 New member
I save the snippets with older names and instead of overwriting the old ones, it is just creating new snippets with the same name.
Now when I want to use the snippet it would just show me same name but different query snippets.

Please help!

#Overwriting_old_snippet_is_not_working
Tagged:

Answers

  • Options

    Thanks for reaching out to us regarding this.

    As a first question, please can you confirm what version of SQL Prompt you are currently using?

    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • Options
    sumeetsumeet Posts: 4 New member
    Hi Dan

    I have Version 10.6.6.18829
  • Options

    Thank you for confirming the version of SQL Prompt you are currently using.

    Were your older snipperts created in a version of SQL Prompt prior to version 10.6? My reason for asking this is that from SQL Prompt v10.6 we changed snippets files to a new JSON file type/format.  When upgrading to SQL Prompt V10.6 your existing snippet files should have automatically converted to this new file format, however I wonder if process this may have failed for you? It could be that your old snippets are still in the old file format, and that your new snippets are being created in the new JSON format?



    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • Options
    sumeetsumeet Posts: 4 New member
    Hi Dan

    Yes old snippets were created in the prior version, and I see all snippets' file type is JSON File.
    I have updated the SQL Prompt so I have the newer version 10.6.9.19.437 and the issue is still there.

    I do see the alert of "Do you want to overwrite the existing snippet 'name'?

    example screenshot below:

  • Options
    Dan_JDan_J Posts: 454 Silver 2

    Thank you for your update on this.

    From what you are describing, I think the issue you are seeing should be resolved by following the steps outlined in this document: https://documentation.red-gate.com/sp/sql-code-formatting-and-styles/updating-style-files-from-before-version-10-5

    I do hope this helps, however please don't hesitate in coming back to us again if you require any further assistance with this.
    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • Options
    Woody___Woody___ Posts: 3 Bronze 1
    edited May 6, 2021 11:12PM
    I am having the same issue. Currently using 10.6.10.19533. 
    I had a number of old xml snippets that seem to have been converted to JSON format but there was a folder in my snippets folder called "backup" that contains all the old snippets in the SQLPRIMPTSNIPPET file format. I moved the backup folder out of my snippets folder and am still encountering the same issue. 

    This problem also occurs when creating brand new snippets and then trying to overwrite the newly created snippet.

    First I created a snippet called test:
    {
      "id": "08af2b13-1df1-4bd2-8895-10046f5f3acd",
      "prefix": "test",
      "description": "",
      "body": "--- This is a test snippet"
    }

    Then I changed the body called and got a separate snippet file:
    {
      "id": "301db8d0-a7d7-4a91-997d-43ad6d35e19f",
      "prefix": "test",
      "description": "",
      "body": "--- This is a test snippet2"
    }

    I then saved this snippet again without changing the body and go a third new snippet:

    {
      "id": "e955034c-0b23-4a12-b6f3-466131a2a68b",
      "prefix": "test",
      "description": "",
      "body": "--- This is a test snippet2"
    }


  • Options
    sumeetsumeet Posts: 4 New member
    Hi @Dan_J

    I followed the guide that you shared and I don't see the "StylesV2-backup" as shown in the #3.

    Should I follow the next steps only with the Styles folder instead?

    Thank you for trying to help :)
  • Options
    Dan_JDan_J Posts: 454 Silver 2

    My sincere apology for the delay in responding to you on this!

    Just one thing to check on this - if you rename your current styles folder to "Styles-tmp", create a new folder called 'StylesV2', paste your old-format style files inside, point SQL Prompt at it (from within the formatting styles settings), and then close and re-pen SSMS, are the files within the "StylesV2" folder then converted to the new JSON format?

    If the above does not work I will look to engage with our development team on this.

    Again, my apology for the delay in getting back to you regarding this!
    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
  • Options
    Gary_SGary_S Posts: 2 New member
    I realize this is an old thread, but I am having the same problem.  It has been happening since early 21 sometime, and I am just now frustrated enough (and actually have 15 min of time to actually look into a solution) to finally try to fix it. 

    In my "snippets" folder, I now ONLY have .json files.  If I go in and re-save a snippet with the same name as an existing one, instead of overwriting the existing snippet json file, it creates another one instead. 

    I suspect maybe its a rights issue?  Does the application run with lesser rights than what I myself would have?  I can manually go into the snippets folder, and PASTE a file with the same name as an existing snippet, and it allows me to do so (asks if I want to overwrite and then it does overwrite when I say YES).

    So, what is the deal?  I really am tired of seeing a list of snippets with the same name to choose from, especially since I noticed that the newest one is not always the one on top!

    Please help
Sign In or Register to comment.