Copy and Paste Snippets

MikeONeillMikeONeill Posts: 131
If you decide after the event that a bit of code you have written would be nice to have as a Snippet .you don't seem to be able to copy and paste it into a new snippet editor box

You have to re type the lot .

I suspect more than a nice to have if you really want the productivity benefits of snippets

Have I missed something ?

Comments

  • I'm not sure what you mean by 'after the event'. But I've tried the process below and it works for me.

    If you copy the text, you want as the snippet, from the query pane. Then go to the Options, click on the Snippets tab and click New... You should be able to paste the code into the Code: box.
  • I have the same problem. The "Code" textbox in the "Snippet Properties" dialog doesn't allow pasting with CTRL+V. Also its context menu is disabled.

    I'm using SQL Prompt 3.1.0.40 on WinXP SP2. I tried this from both QA and SMSS.

    For now I'm just editing the SQL Prompt 3 Snippets.xml directly.
  • i see in this forum the copy/paste has been reported for a while as an issue in the options-snippit window... i see its still not fixed...

    is there any workaround - can i put it in a file on the local disk that prompt reads from? i would hate to type the lines i have to paste...
  • Look for the file:
    SQL Prompt 3 Snippets.xml

    in Vista its in:
    C:\Users\YOURUSER-SAMACCOUNTNAME\AppData\Local\Red Gate\SQL Prompt 3to make it easy i created a snippit thru the options screen just to get it to create all the nodes... then i went into the xml file and replaced the <Code> text.... I tested using the CDATA tag so that the xml parser wouldnt trip over my sql - it worked great.....

    <Code>
    <![CDATA[

    YOUR SQL SNIPPIT GOES HERE

    ]]>
    </Code>
  • What I meant was that once you had coded a query you can copy it to ClipBoard and then create a snippet from it

    I have just tried again and RH mouse doesn't give a context menu and Ctr V fails as well

    It fails for both New and Edit snippets

    It may be a setting but I get the same behaviour on 2 PC's

    :(
  • What is the location of snippets.xml file in XP? I can't seem to find it. This is an awfully silly bug. Any plans to fix it?
  • i am not in front of an xp machine right now - but approximately this...
    c:\documents and settings\your profile name\application data\local...\....[the rest of the path in the message above]

    or you can just search your harddisk for the xml file name too...
Sign In or Register to comment.