Add your snippet to the Features folder, where other SurroundsWith snippets are found. Then press CTRL + K, CTRL + S (shortcut for SurroundsWith Snippets) and enter a few letters from your fragment name and press enter. If only the Functions folder has SurroundsWith snippets, other folders are not displayed in other contexts in the context menu. Otherwise, you can enter several letters from the corresponding folder name and click the tab. This process is very similar to this answer.
Begin, If, and While fragments were found in my environment:
C: \ Program Files (x86) \ Microsoft SQL Server \ 130 \ Tools \ Binn \ ManagementStudio \ SQL \ Excerpts \ 1033 \ Function
Here is an example snippet for SELECT * FROM:
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>Select</Title> <Shortcut>sel</Shortcut> <Description>SELECT * FROM _ WHERE 1=1 AND</Description> <Author/> <SnippetTypes> <SnippetType>SurroundsWith</SnippetType> </SnippetTypes> </Header> <Snippet> <Code Language="SQL"> <![CDATA[ SELECT * FROM dbo.$selected$$end$ WHERE 1=1 --AND ]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
Hans vonn
source share