Skip to content
Projects

olahallengren/sql-server-maintenance-solution

View on GitHub

olahallengren/sql-server-maintenance-solution has 3,529 GitHub stars and 887 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-08 16:39 UTC. Last push 2026-09-12.

How these counts are measured

SQL Server Maintenance Solution

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

SQL Server Maintenance Solution

licence badge stars badge forks badge issues badge bug report badge SQL Server bug badge feature request badge

Getting Started

Download the script for your platform:

  • MaintenanceSolution.sql: SQL Server 2017, SQL Server 2019, SQL Server 2022, SQL Server 2025, and Azure SQL Managed Instance. This script creates all the objects and jobs that you need.
  • MaintenanceSolutionAzureSQLDatabase.sql: Azure SQL Database. This script creates the objects for integrity check and index and statistics maintenance.

You can also download the objects as separate scripts:

Note that you always need CommandExecute; DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize use it.

When you update DatabaseBackup, DatabaseIntegrityCheck, or IndexOptimize, you should also update CommandExecute.

You need CommandLog if you are going to use the option to log commands to a table.

You can verify the scripts against the SHA-256 checksums in SHA256SUMS.txt.

Documentation

Explore related projects