Transact‑SQL (T‑SQL) – Introduction

Transact‑SQL (T‑SQL) is Microsoft’s and Sybase’s proprietary extension to the SQL language used by Microsoft SQL Server and Azure SQL Database. It adds programming constructs, such as variables, loops, error handling, and functions, to the ANSI‑SQL standard.

Key Features

Basic Syntax

A simple SELECT statement:

SELECT FirstName, LastName
FROM   dbo.Employees
WHERE  IsActive = 1
ORDER BY LastName;

Creating a stored procedure:

CREATE PROCEDURE dbo.GetEmployee
    @EmpID int
AS
BEGIN
    SET NOCOUNT ON;
    SELECT *
    FROM dbo.Employees
    WHERE EmployeeID = @EmpID;
END;

Learning Path

Start with the basic SELECT, then explore data modification statements, and finally move on to advanced topics.