--- title: "Transact-SQL Code Snippets | Microsoft Docs" ms.custom: "" ms.date: "06/13/2017" ms.prod: "sql-server-2014" ms.reviewer: "" ms.technology: "database-engine" ms.topic: conceptual ms.assetid: 12834855-535a-4102-8b19-5d18b4080926 author: MightyPen ms.author: genemi manager: craigg --- # Transact-SQL Code Snippets A [!INCLUDE[tsql](../../includes/tsql-md.md)].code snippet is a template containing the basic structure of a [!INCLUDE[tsql](../../includes/tsql-md.md)] statement or block. You can use snippets as a starting point when adding statements in the [!INCLUDE[ssDE](../../includes/ssde-md.md)] Query Editor. You can insert the pre-defined snippets supplied with SQL Server, or create your own. ## Transact-SQL Code Snippet Tasks |Task Description|Topic| |----------------------|-----------| |Describes how to insert an existing snippet, such as a CREATE TABLE or SELECT snippet.|[Insert Transact-SQL Snippets](insert-transact-sql-snippets.md)| |Describes how to enclose a set of [!INCLUDE[tsql](../../includes/tsql-md.md)] statements in a BEGIN, IF, or WHILE block.|[Insert Surround-with Transact-SQL snippets](insert-surround-with-transact-sql-snippets.md)| |Describes how to finish building a complete [!INCLUDE[tsql](../../includes/tsql-md.md)] statement or block after inserting a code snippet.|[Complete Transact-SQL Snippets](complete-transact-sql-snippets.md)| |Describes how to build your own custom snippets and add them to the set of SQL Server snippets.|[Add Transact-SQL Snippets](add-transact-sql-snippets.md)| ## See Also [Query and Text Editors (SQL Server Management Studio)](../scripting/query-and-text-editors-sql-server-management-studio.md)