Transact-SQL
Transact-SQL (T-SQL) is an extension of SQL used by Microsoft SQL products and services, including Microsoft SQL Server, and by SAP Adaptive Server Enterprise (SAP ASE). Microsoft states that tools and applications communicating with a SQL Server database do so by sending T-SQL commands. SAP describes its implementation as an enhanced version of the relational database language.
Transact-SQL (T-SQL) is an extension of SQL used by Microsoft SQL products and services, including Microsoft SQL Server, and by SAP Adaptive Server Enterprise (SAP ASE). Microsoft states that tools and applications communicating with a SQL Server database do so by sending T-SQL commands. SAP describes its implementation as an enhanced version of the relational database language. ==History== In January 1988, Microsoft and Ashton-Tate announced Microsoft SQL Server, based on a relational database management system licensed from Sybase. Sybase Adaptive Server Enterprise was later renamed SAP Adaptive Server Enterprise. Microsoft and SAP publish separate Transact-SQL documentation for their respective database systems. ==Microsoft implementation== The features described in this section refer to Microsoft's implementation of Transact-SQL. ===Variables and control flow=== Local variables begin with an at sign ( @ ) and are declared using DECLARE . A newly declared variable has the value NULL . Values can be assigned using SET or SELECT , although Microsoft recommends SET for variable assignment. Control-flow constructs include BEGIN...END , IF...ELSE , WHILE , BREAK , CONTINUE , RETURN , GOTO , WAITFOR , THROW , and TRY...CATCH . ===Stored procedures and error handling=== Stored procedures can accept input parameters, return values through output parameters, contain statements that operate on a database, and return a status value to their caller. The TRY...CATCH construct transfers control to a CATCH block when certain execution errors occur inside its associated TRY block. ===Data modification and bulk loading=== Transact-SQL extends the DELETE statement with an additional FROM clause, allowing rows to be identified using joined table sources. Its UPDATE statement also accepts a FROM clause containing table, view, or derived-table sources used to determine which rows are updated. The BULK INSERT statement imports data from a file into a table or view. Depending on the Microsoft database product, the source can be a file accessible to the server or a file in Azure Storage. ==See also== PL/SQL PL/pgSQL SQL/PSM Tabular Data Stream ==References==
References
- BULK INSERT (Transact-SQL) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "BULK INSERT (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql. Accessed 24 November 2026.
Chicago "BULK INSERT (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql.
APA encyclopegia.org. (2026). BULK INSERT (Transact-SQL). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql
- Control-of-Flow · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "Control-of-Flow." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/control-of-flow. Accessed 24 November 2026.
Chicago "Control-of-Flow." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/control-of-flow.
APA encyclopegia.org. (2026). Control-of-Flow. Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/language-elements/control-of-flow
- DELETE (Transact-SQL) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "DELETE (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql. Accessed 24 November 2026.
Chicago "DELETE (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql.
APA encyclopegia.org. (2026). DELETE (Transact-SQL). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql
- The History of Microsoft – 1988 · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "The History of Microsoft – 1988." 2026-11-17. https://learn.microsoft.com/en-us/shows/history/history-of-microsoft-1988. Accessed 24 November 2026.
Chicago "The History of Microsoft – 1988." 2026-11-17. https://learn.microsoft.com/en-us/shows/history/history-of-microsoft-1988.
APA encyclopegia.org. (2026). The History of Microsoft – 1988. Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/shows/history/history-of-microsoft-1988
- Transact-SQL Reference (Database Engine) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "Transact-SQL Reference (Database Engine)." a b "Transact-SQL Reference (Database Engine)". 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-reference. Accessed 24 November 2026.
Chicago "Transact-SQL Reference (Database Engine)." a b "Transact-SQL Reference (Database Engine)". 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-reference.
APA a b "Transact-SQL Reference (Database Engine)". (2026). Transact-SQL Reference (Database Engine). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/language-reference
- CREATE PROCEDURE (Transact-SQL) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "CREATE PROCEDURE (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql. Accessed 24 November 2026.
Chicago "CREATE PROCEDURE (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql.
APA encyclopegia.org. (2026). CREATE PROCEDURE (Transact-SQL). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql
- What is Sybase? · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "What is Sybase?." 2026-11-17. https://www.sap.com/products/acquired-brands/what-is-sybase.html. Accessed 24 November 2026.
Chicago "What is Sybase?." 2026-11-17. https://www.sap.com/products/acquired-brands/what-is-sybase.html.
APA encyclopegia.org. (2026). What is Sybase?. Retrieved November 24, 2026, from https://www.sap.com/products/acquired-brands/what-is-sybase.html
- Transact-SQL Users Guide · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "Transact-SQL Users Guide." a b "Transact-SQL Users Guide". 2026-11-17. https://help.sap.com/docs/SAP_ASE/b65d6a040c4a4709afd93068071b2a76/a662eddabc2b1014889ed3e9624a84bd.html. Accessed 24 November 2026.
Chicago "Transact-SQL Users Guide." a b "Transact-SQL Users Guide". 2026-11-17. https://help.sap.com/docs/SAP_ASE/b65d6a040c4a4709afd93068071b2a76/a662eddabc2b1014889ed3e9624a84bd.html.
APA a b "Transact-SQL Users Guide". (2026). Transact-SQL Users Guide. Retrieved November 24, 2026, from https://help.sap.com/docs/SAP_ASE/b65d6a040c4a4709afd93068071b2a76/a662eddabc2b1014889ed3e9624a84bd.html
- TRY...CATCH (Transact-SQL) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "TRY...CATCH (Transact-SQL)." "TRY. 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/try-catch-transact-sql. Accessed 24 November 2026.
Chicago "TRY...CATCH (Transact-SQL)." "TRY. 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/try-catch-transact-sql.
APA "TRY. (2026). TRY...CATCH (Transact-SQL). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/language-elements/try-catch-transact-sql
- UPDATE (Transact-SQL) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "UPDATE (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql. Accessed 24 November 2026.
Chicago "UPDATE (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql.
APA encyclopegia.org. (2026). UPDATE (Transact-SQL). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql
- Variables (Transact-SQL) · retrieved 2026-11-17 · rev 1378912282
Cite this reference
MLA "Variables (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/variables-transact-sql. Accessed 24 November 2026.
Chicago "Variables (Transact-SQL)." 2026-11-17. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/variables-transact-sql.
APA encyclopegia.org. (2026). Variables (Transact-SQL). Retrieved November 24, 2026, from https://learn.microsoft.com/en-us/sql/t-sql/language-elements/variables-transact-sql
Cite this article
MLA
"Transact-SQL." encyclopegia.org, 2026, https://encyclopegia.org/wiki/transact-sql. Accessed 24 November 2026.
Chicago
"Transact-SQL." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/transact-sql.
APA
encyclopegia.org. (2026). Transact-SQL. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/transact-sql
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON