Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL SERVER 2014 Code Snippets missing

I'm trying to use the Snippets functionality in SQL Server.

I'm testing out adding new snippets to SQL Server 2014 following the instruction here.

Everything works fine except that after I added the snippet, it doesn't show up in the IntelliSense. Even more, I realized that not all build-in Snippets are showing up.

I wonder if anyone else has the same experience, and knows how to resolve this?

This is a list of build-in snippets under Function

build-in

And this is what I see from IntelliSense (3 of them are missing)

missing snippet

like image 725
xbb Avatar asked Mar 17 '23 09:03

xbb


1 Answers

The issue is likely in the definition of the snippets.

If you inspect your snippets you should see a section like:

<SnippetTypes>
    <SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>

Or

<SnippetTypes>
    <SnippetType>Expansion</SnippetType>
</SnippetTypes>

These indicate where the snippet can and will be used from.

In a query window you have 2 options when you right click:

  • Insert snippet
  • Surround with

Which give you the different options as you can see here:

enter image description here

enter image description here

This explains why you're not seeing the missing options when you try to insert a snippet.

like image 125
Tanner Avatar answered Mar 23 '23 08:03

Tanner