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>
whytheq
  • 34,466
  • 65
  • 172
  • 267
  • 1
    Related, and most likely the answer: http://stackoverflow.com/questions/2100227/visual-studio-code-snippets-cursor – lc. Mar 18 '13 at 14:08
  • @Ic thanks....did you up it + say its a duplicate? (...which it looks like it is!) – whytheq Mar 18 '13 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?) – lc. Mar 18 '13 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? – whytheq Mar 19 '13 at 20:29
  • 1
    Go ahead and answer it if you'd like :) – lc. Mar 21 '13 at 00:41

1 Answers1

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>
whytheq
  • 34,466
  • 65
  • 172
  • 267