What is T-SQL in SQL Server?
What is T-SQL in SQL Server?
2393
18-Dec-2023
Updated on 08-Jan-2025
Khushi Singh
08-Jan-2025T-SQL or Transact Structured Query Language is a Microsoft developed SQL DBMS that is used for Microsoft SQL Server. It improves the standard SQL by adding further programming constructs, other options, and improved features specifically for managing data in SQL Server. T-SQL serves a purpose of allowing the programmers to communicate with the Database Server in order to generate and run queries, perform flow control and managing of data.
Key Features of T-SQL:
Control-of-Flow Statements:
Gives such tools as
IF,WHILE,CASE, andBEGIN…ENDto perform logic and to control the work of the code.Procedural Programming:
Allows creation of stored procedures, functions and triggers so as to form blocks of reusable codes.
Variables and Parameters:
Provides an opportunity to create local variables and parameters used to save data temporarily during the execution of a query.
Advanced Functions:
Has inherent capabilities of string manipulation, Date and time manipulation along with complex calculations.
Error Handling:
Has TRY…CATCH that allows for courteous handling of errors while in T-SQL scripts.
Transaction Control:
Recognizes and supports SQL calls such as
BEGINTRANSACTION,COMMIT, andROLLBACKfor creating, committing and rolling back database transactions for data integrity.