Skip to content
IT glossary
DatabasesUpdated December 3, 2026

Microsoft SQL Server

A relational database management system from Microsoft. It stores data in tables, manages access and changes, and uses a dialect of SQL called T-SQL.

Also known as: MS SQL, T-SQL

What it is

Microsoft SQL Server, sometimes called MS SQL, is a database engine that applications connect to. In an order system, for instance, a customer can have one row in a Customers table and many rows in an Orders table. The database can enforce that every order references an existing customer, and a query can join the two tables to show the customer's name alongside each order.

SQL Server is the product. Transact-SQL (T-SQL) is the SQL dialect it uses, with features such as local variables, stored procedures, and TRY...CATCH error handling. SQL Server Management Studio (SSMS) is a separate client for running queries and administering the server. Applications typically connect through a database driver instead.

What happens when a query runs

A query describes the result you want, not the steps the engine must take to get it. SQL Server can reuse a cached execution plan or compile a new one. When compiling, the optimizer uses statistics to estimate how many rows each operation will process and compares possible plans. Reading a large share of a table may be cheaper than doing many individual lookups, so seeing a scan in a plan does not automatically mean an index is missing.

The engine also coordinates concurrent work. A transaction can group an order insert and a stock update so that they commit together or roll back together. The isolation level controls what one transaction can observe while others are running. SQL Server records changes in a transaction log, which it uses during crash recovery to preserve committed work and undo incomplete transactions.

Example: keeping the latest order per customer

WITH RankedOrders AS (
    SELECT CustomerId, OrderId, CreatedAt,
           ROW_NUMBER() OVER (
               PARTITION BY CustomerId
               ORDER BY CreatedAt DESC, OrderId DESC
           ) AS RowNum
    FROM dbo.Orders
)
SELECT CustomerId, OrderId, CreatedAt
FROM RankedOrders
WHERE RowNum = 1;

ROW_NUMBER() starts a new ranking for each customer. The newest order gets rank 1, with the unique OrderId breaking ties when timestamps match. This ranks orders within each customer; it does not sort the final result. If the caller needs the output in customer order, add ORDER BY CustomerId to the outer query.

Where it fits and what interviewers ask

SQL Server is used for transactional workloads such as billing and inventory, as well as reporting. It's common in .NET environments but isn't limited to them. SQL Server runs on Windows and Linux; Azure SQL Database is a related managed service, not another name for a self-managed SQL Server instance.

A typical interview prompt is: “This query is slow even though the table has an index. What would you check?” Start with the actual execution plan. Look for large differences between estimated and actual row counts, then check where the query does the most work. If you propose an index, explain which filters or sort order it would support and what it would cost in storage and write overhead.