🪟

Microsoft SQL Server

SQL Server is Microsoft's relational (SQL) database, using the T-SQL dialect and deeply integrated with the .NET and Windows ecosystem. It's the fourth most-used database in developer surveys, at roughly 30.1% usage share. It's especially common in large enterprise IT environments that have standardized on Microsoft tooling, from Windows Server to Active Directory to Visual Studio.

Quick facts
Type: Relational (SQL), T-SQL dialect
Made by: Microsoft
License: Paid/proprietary, with a free SQL Server Express edition
Hosting: Windows-first, also runs on Linux and Docker; self-hosted or Azure-managed
Primary use case: Enterprise line-of-business applications, especially in .NET/Windows shops
Jump to: ExampleGetting startedBest for

Example

T-SQL's TOP clause limits rows (instead of standard SQL's LIMIT), and stored procedures are a core part of the workflow.

SELECT TOP 10 CustomerName, OrderTotal
FROM Orders
WHERE OrderDate >= DATEADD(day, -30, GETDATE())
ORDER BY OrderTotal DESC;

CREATE PROCEDURE GetTopCustomers
AS
BEGIN
  SELECT TOP 5 CustomerName, SUM(OrderTotal) AS Total
  FROM Orders
  GROUP BY CustomerName
  ORDER BY Total DESC;
END;

Getting started

Run the free Developer/Express edition locally, or use Docker on Linux/Mac, then connect with SSMS or sqlcmd.

# Docker: run a local SQL Server instance
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStr0ng!Pw" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest

# connect with sqlcmd
sqlcmd -S localhost -U sa -P "YourStr0ng!Pw"
Best for: Enterprise applications built on .NET and Windows infrastructure, where tight integration with Active Directory, Azure, and Visual Studio tooling outweighs the licensing cost.