New training course: Customizing SQL Prompt. Watch now.

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


  • 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?
  • sumeetsumeet Posts: 4 New member
    Hi Dan

    I have Version 10.6.6.18829

  • 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?
  • 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:

  • Dan_JDan_J Posts: 90 Bronze 1

    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?
  • Woody___Woody___ Posts: 1 New member
    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"
    }


  • 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 :)

  • 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?
Sign In or Register to comment.