Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 2.24 KB

File metadata and controls

45 lines (34 loc) · 2.24 KB
title Insert Surround-with Transact-SQL snippets
description Learn how to insert a surround-with snippet to serve as a starting point for placing statements in code blocks.
ms.custom seo-lt-2019
ms.date 03/14/2017
ms.prod sql
ms.prod_service sql-tools
ms.technology ssms
ms.reviewer
ms.topic conceptual
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
author markingmyname
ms.author maghan
monikerRange >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current

Insert Surround-with Transact-SQL snippets

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW ] 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