Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 2.25 KB

File metadata and controls

52 lines (40 loc) · 2.25 KB
title Insert Surround-with Transact-SQL snippets | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-non-specified
ms.prod_service sql-tools
ms.service
ms.component ssms-scripting
ms.reviewer
ms.suite sql
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 MightyPen
ms.author genemi
manager craigg
ms.workload Inactive

Insert Surround-with Transact-SQL snippets

[!INCLUDEappliesto-ss-asdb-asdw-pdw-md] 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