Transact-SQL 程式碼片段Transact-SQL Code Snippets

本主題適用於: 是SQL Server是Azure SQL Database是Azure SQL 資料倉儲 是平行處理資料倉儲 THIS TOPIC APPLIES TO: yesSQL ServeryesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Transact-SQLTransact-SQL程式碼片段是包含 Transact-SQLTransact-SQL 陳述式或區塊之基本結構的範本。A Transact-SQLTransact-SQL.code snippet is a template containing the basic structure of a Transact-SQLTransact-SQL statement or block. 當您在 Database EngineDatabase Engine 查詢編輯器中加入陳述式時,您可以使用程式碼片段做為起點。You can use snippets as a starting point when adding statements in the Database EngineDatabase Engine Query Editor. 您可以插入 SQL Server 所提供的預先定義程式碼片段,或是建立您自己的程式碼片段。You can insert the pre-defined snippets supplied with SQL Server, or create your own.

Transact-SQL 程式碼片段工作Transact-SQL Code Snippet Tasks

工作描述Task Description 主題Topic
描述如何插入現有的程式碼片段,例如 CREATE TABLE 或 SELECT 程式碼片段。Describes how to insert an existing snippet, such as a CREATE TABLE or SELECT snippet. 插入 Transact-SQL 程式碼片段Insert Transact-SQL Snippets
描述如何在 BEGIN、IF 或 WHILE 區塊中封入一組 Transact-SQLTransact-SQL 陳述式。Describes how to enclose a set of Transact-SQLTransact-SQL statements in a BEGIN, IF, or WHILE block. 插入範圍陳述式 Transact-SQL 程式碼片段Insert Surround-with Transact-SQL snippets
描述如何在插入程式碼片段之後,完成建立完整的 Transact-SQLTransact-SQL 陳述式或區塊。Describes how to finish building a complete Transact-SQLTransact-SQL statement or block after inserting a code snippet. 完成 Transact-SQL 程式碼片段Complete Transact-SQL Snippets
描述如何建立您自己的自訂程式碼片段,並將其加入至一組 SQL Server 程式碼片段。Describes how to build your own custom snippets and add them to the set of SQL Server snippets. 新增 Transact-SQL 程式碼片段Add Transact-SQL Snippets

另請參閱See Also

查詢與文字編輯器 (SQL Server Management Studio)Query and Text Editors (SQL Server Management Studio)