4

Can I amend this code snippet so that when I use the snippet SSMSs cursor is at the end of the snippet ready for me to carry on writing the script?

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<_locDefinition xmlns="urn:locstudio">
    <_locDefault _loc="locNone" />
    <_locTag _loc="locData">Title</_locTag>
    <_locTag _loc="locData">Description</_locTag>
    <_locTag _loc="locData">Author</_locTag>
    <_locTag _loc="locData">ToolTip</_locTag>
   <_locTag _loc="locData">Default</_locTag>
</_locDefinition>
<CodeSnippet Format="1.0.0">
<Header>
<Title>top10star</Title>
<Description>my first snippet</Description>
<Author>Me</Author>
</Header>
<Snippet>
<Code Language="SQL"><![CDATA[SELECT TOP 10 * FROM]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
5
  • 1
    Related, and most likely the answer: stackoverflow.com/questions/2100227/… Commented Mar 18, 2013 at 14:08
  • @Ic thanks....did you up it + say its a duplicate? (...which it looks like it is!) Commented Mar 18, 2013 at 14:15
  • I'm not sure it's a 100% duplicate, as that question is for VS, and this one is specifically SSMS (based on the VS engine but not exactly the same thing?) Commented Mar 18, 2013 at 14:19
  • @Ic - I think the info in that question is the answer - should I answer this question myself to close it of or do you want to? Commented Mar 19, 2013 at 20:29
  • 1
    Go ahead and answer it if you'd like :) Commented Mar 21, 2013 at 0:41

1 Answer 1

3

I ended up with the following:

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<_locDefinition xmlns="urn:locstudio">
    <_locDefault _loc="locNone" />
    <_locTag _loc="locData">Title</_locTag>
    <_locTag _loc="locData">Description</_locTag>
    <_locTag _loc="locData">Author</_locTag>
    <_locTag _loc="locData">ToolTip</_locTag>
   <_locTag _loc="locData">Default</_locTag>
</_locDefinition>
<CodeSnippet Format="1.0.0">
<Header>
<Title>top10star</Title>
<Description>my first snippet</Description>
<Author>Me</Author>
</Header>
<Snippet>
<Code Language="SQL">
<![CDATA[SELECT TOP 10 * FROM$selected$ $end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.