Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 2.03 KB

File metadata and controls

47 lines (35 loc) · 2.03 KB
title Insert Surround-with Transact-SQL snippets | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-server-2016
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
snippets [Transact-SQL], surround with
IntelliSense [SQL Server], surround with snippets
Transact-SQL snippets, surround with
ms.assetid 5b5a8c6c-968e-4361-a7f5-9e2ac186d927
caps.latest.revision 6
author BYHAM
ms.author rickbyh
manager jhubbard

Insert Surround-with Transact-SQL snippets

A surround-with snippet is a template you can use as a starting point when enclosing a set of [!INCLUDEtsql] statements in a BEGIN, IF, or WHILE block.

Inserting Surround-with Snippets

Surround-with snippets can be launched by one of three ways: through a keyboard shortcut, through the Edit menu, and through the context menu.

After inserting the snippet, you must change the replacement text to form a valid [!INCLUDEtsql] statement. For more information, see Complete Transact-SQL Snippets.

To insert a surround-with snippet

  1. In the [!INCLUDEssDE] Query Editor window, select the set of statements to be included in the block.

  2. Use one of these three methods to display the list of surround-with snippets:

    • Type CTRL+K, CTRL+S.

    • From the Edit menu, point to IntelliSense, and then select the Surround With command.

    • Right-click the selected text, and then select the Surround With command from the context menu.

  3. Select the name of the snippet (BEGIN, IF, or WHILE) from the list either by using the mouse, or by typing the name of the snippet and pressing TAB or ENTER.

See Also

Insert Transact-SQL Snippets