SQL Reference Home

Welcome to the Microsoft SQL Server Transact-SQL (T-SQL) reference documentation. This section provides comprehensive information on the syntax, functions, statements, and data types used in SQL Server.

T-SQL Syntax

Understand the fundamental structure and rules for writing valid T-SQL queries and statements.

Learn about T-SQL Syntax →

T-SQL Functions

Explore the wide range of built-in functions available to manipulate data, perform calculations, and manage your database.

Browse all T-SQL Functions →

T-SQL Statements

Master the various statements used for creating, manipulating, and controlling access to your data.

View T-SQL Statements →

T-SQL Data Types

Understand the different types of data you can store in SQL Server and their properties.

Explore T-SQL Data Types →

Stored Procedures

Learn how to create and use stored procedures to encapsulate logic and improve performance.

Stored Procedure Reference →

Views

Discover how views can be used to simplify complex queries and enhance security.

View Reference →

Getting Started with T-SQL

T-SQL is the procedural extension of SQL that provides the following capabilities:

  • Control-of-flow language statements.
  • Local variables.
  • Specialized procedural programming constructs.
  • Error handling.

Here's a simple example of a SELECT statement:

SELECT CustomerID, CompanyName
FROM Customers
WHERE Country = 'USA';

Commonly Used Resources

Date and Time Functions

Functions for working with date and time values.

String Functions

Functions for manipulating string data.

Mathematical Functions

Functions for performing mathematical operations.