Transact-SQL

Transact-SQL, often abbreviated as T-SQL, is an extension of SQL ([[Structured Query Language]]) used in [[Microsoft SQL Server]] and [[Sybase]] ASE (Adaptive Server Enterprise).

T-SQL expands upon the standard SQL language to include procedural programming, local variables, various support functions for string processing, date processing, mathematics, etc., and changes to the DELETE and UPDATE statements.

T-SQL includes procedural programming features, such as the ability to declare variables, write IF...ELSE statements, and create loops. This allows for more complex and dynamic SQL scripts compared to standard SQL.

It includes statements like BEGIN...END, WHILE, WAITFOR, and GOTO, which can control the flow of execution in a T-SQL script or stored procedure. T-SQL has a rich set of built-in functions for various operations like string manipulation, mathematical calculations, date processing, and system functions.

Primarily used with Microsoft SQL Server and Sybase ASE, T-SQL scripts are specific to these environments and may not be fully compatible with other SQL-based database systems without modifications.