欢迎~

Hope is a good thing...Maybe the best of things. And no good thing ever dies..     
隐藏

SQLSERVER - SNIPPETS

A Transact-SQL code snippet is to create an XML file with the text of your code snippet. The file must have a .snippet file extension, and meet the requirements of the Code Snippets Schema. Set the snippet language to SQL. You can use the pre-defined snippets that ship with SQL Server as examples

  1. Creating a Transact-SQL Snippet File , The file must have a .snippet file extension

          Example:

             < Title > represents the Title of the snippet;
             < snippetTypes > can contain more than one < snippetType >,
                     There are three values (Expansion, Surroundswidth, and Refactoring).
                           Expansion: allows code to be inserted at the cursor;
                           SurroundsWith: allows code to wrap around the selected code;
                           Refactoring: specifies the snippet used during the C# Refactoring process,
                      Cannot be used in custom snippets. If the values are left unset, the snippet can be placed anywhere;
               <Snippet>The node is where Code management is implemented and contains four children, , , , and , where our Code is written on the node.

                    2. Add the Snippet file you have created. (Ctrl+K , Ctrl+B)

                        Tool >> Code Snippets manager >>Add 

 

            3. Insert a snippet (Ctrl+K, Ctrl+X)

                  Press CTRL+K, CTRL+X.

                 On the Edit menu, point to the file you needed, then click Insert Snippet.

                 Right-click the mouse and then select the Insert Snippet command from the shortcut menu.

posted @ 2021-07-15 14:17  Tuzi_ya  阅读(88)  评论(0)    收藏  举报