SQL Server Maintenance Solution is seven scripts with no releases and no uninstall
SQL Server Maintenance Solution
At a glance
- What is it?
- A MIT licensed set of T-SQL scripts that create the stored procedures, tables and scheduled jobs for backing up, checking integrity and rebuilding indexes, in two aggregate installers covering four SQL Server versions plus two Azure variants. The design is admirably dependency-light and the checksums are published, which is rarer than it should be for scripts people run with administrator rights. Two things the readme does not solve: which version you have, and how to undo any of it.
- Who is it for?
- This solution suits an administrator who wants the well-known community scripts rather than the built-in maintenance plan wizard, and the object list is small enough to read in full before running anything. Four things to establish first.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 71 days ago.
- What is it written in?
- Mainly TSQL, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- olahallengren/sql-server-maintenance-solution3,540 ★ · +48
| Repository | 2026-09-24 | 2026-11-22 |
|---|---|---|
| olahallengren/sql-server-maintenance-solution | 3.5k | 3.5k |
48 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One script for four versions, and a narrower one for Azure SQL Database
There are two aggregate installers and they are not equivalent, which is stated in a single clause and is easy to miss.
The main one covers SQL Server 2017, 2019, 2022 and 2025, plus Azure SQL Managed Instance. Its description says it creates all the objects and jobs that you need.
The second covers Azure SQL Database, and its description says it creates the objects for integrity check and index and statistics maintenance.
So on the on-premises and Managed Instance path you get scheduled jobs as well as objects, and on the Azure SQL Database path you get three maintenance capabilities and nothing else. The readme does not explain the difference, and does not say why backup is absent from the Azure Database path, which is plausibly because that service handles its own backups. That reasoning is a reasonable inference from the product rather than a statement in the file, and the file does not make it.
The version list is worth noting on its own. One file claims compatibility with four consecutive major releases of the database engine, from 2017 through 2025. There is no separate script per version and no minimum listed below 2017.
If you are on the Managed Instance path, the phrase to hold onto is jobs. The deployment is not confined to one database, it schedules work at the instance level.
CommandExecute is mandatory and must move in lockstep
Seven objects ship separately, and the dependency rules between them are stated precisely, which is better than most projects of this kind manage.
There is one procedure that is always required. CommandExecute is a stored procedure to execute and log commands, and the readme says you always need it, because the three maintenance procedures use it.
Those three are the procedures doing the actual work: one to back up databases, one to check their integrity, and one to rebuild and reorganise indexes and update statistics.
The important line is the upgrade rule. When you update any of those three maintenance procedures, you should also update CommandExecute. So the four files move together, and a partial upgrade leaves you with a maintenance procedure calling into a helper from a different release.
That is a real constraint on how you deploy upgrades, and it is easy to get wrong precisely because each of the three is documented as a separately downloadable script. Someone taking only the file they care about will break the set.
The remaining two are tables rather than procedures, and both are described as tables for processing databases in parallel. Neither is described as required.
The fifth object, a table to log commands, is conditional rather than optional. The readme says you need it if you are going to use the option to log commands to a table, which implies the logging behaviour of the mandatory helper has at least two destinations and one of them needs this table.
Queue and QueueDatabase are described identically
Two of the seven objects have the same description, word for word.
Both are described as a table for processing databases in parallel. That is the entire description of each, and there is no further note distinguishing them anywhere in the readme.
From the names you would guess one is the work queue and the other records which databases are being processed, since that is the usual way to parallelise a maintenance run across databases and it needs two pieces of state rather than one. That is a reasonable reading of the names, and it is not stated in the file.
This matters more than a thin description usually does, because parallel processing is where correctness bugs live. A maintenance solution that fans out across databases has to handle a database being dropped mid-run, two workers picking up the same database, a restart partway through, and a partially rebuilt index left behind. The two tables are where the coordination for those cases sits, and neither is described in enough detail to reason about from the readme.
The detailed documentation does exist, but for this it is on the website rather than in the repository, which is the same split that affects the FAQ and the version history.
If parallel processing is something you intend to rely on, the two files are the ones to read before you run anything, and the readme will not tell you what is in them.
Checksums are published, and they answer a narrower question than you want
The repository ships a checksum file, and that is worth more attention than it first appears for a project of downloaded scripts.
There is a file at the top level listing SHA-256 checksums, and the readme tells you that you can verify the scripts against it. So the integrity of a download is checkable, and a modified script would run with your rights rather than being inspected.
Now the limitation. A checksum answers whether a given file is the one the publisher intended. It does not answer whether the files you have are from the same release as each other. And in this project that is a live concern, because the readme's own upgrade rule tells you that three procedures must be updated together with a fourth.
So you can confirm that your copy of each of those four files is authentic, and still end up with a mixture of two releases, because authenticity and coherence are different properties. The file list gives you no way to check the second one.
There is also no version marker to compare against, which is the subject of the next section.
Worth saying plainly: publishing checksums at all is above the norm here, and the gap is not that the mechanism is missing but that it addresses file tampering rather than release coherence.
The FAQ and the version history exist only on a website
The documentation links are not symmetrical, and the two that are missing from the repository are the two you would most want offline.
Three topics are dual-published. Backup, integrity check, and index and statistics maintenance each link to a page on the project website and to a matching file in the repository's docs directory. Those you can read in a pull request, diff, and search.
Two are website-only. The frequently asked questions page has no repository counterpart, and the version history page has no repository counterpart.
The version history is the consequential one. This project has no GitHub releases, so there are no tags to pin and no release notes in the repository. The changelog is a page on a personal domain. So when you want to know what changed between the version you are running and the version you are about to install, the only source is a web page that the project does not version, diff or review.
That is a real limitation for a solution whose procedures change often enough that the upgrade rule I described earlier matters. You are being asked to keep four files in step without being given an in-repository record of which release each belongs to.
The hosting is also worth noting as a dependency. The canonical documentation lives on one person's personal domain, and the repository URL carries their name. That is a single point of failure for the documentation of a widely used operational tool, and it is a deliberate choice rather than an oversight, but it is a choice a reader should be aware of.
Three issue labels separate script bugs from SQL Server bugs
The badge definitions at the foot of the readme are unusual and better thought through than they look.
There are seven badges. Two are the ordinary kind, one for the licence and one for the star count. Two more are counts for forks and open issues. The remaining three are not counts at all. They are direct links to issue searches filtered by label, one for bug reports, one for SQL Server bugs, and one for feature requests.
So the project publishes three links whose only job is to make three queues visible from the front page, and it is telling you that the queues are separate on purpose.
The interesting one is the middle label. Distinguishing a bug in these scripts from a bug in SQL Server itself is not a distinction most wrappers bother to make, and it changes what a reporter should do next. One is something the maintainer can fix; the other needs to go to the vendor, or to be worked around in the script. Putting them in separate labelled queues means triage starts from the right place.
That is also an implicit statement about the project's scope. It wraps a vendor product across four major versions, so it necessarily accumulates cases where correct scripts behave surprisingly because the engine underneath does something undocumented. Giving those cases their own label is how you keep them from drowning out the bugs that are fixable here.
The licence itself is MIT, with a licence file at the top level and a badge pointing at it.
Seven scripts, no build, and nothing about undoing any of it
The repository is seven SQL files and a readme, and the deployment model follows from that.
The top level contains a version-control attributes file, a directory for the automation the hosting service uses, the seven scripts, a licence file, this readme, the checksum file, and the documentation directory. There is no build configuration, no package manifest, no installer and no dependency to resolve. Primary language is T-SQL.
So adoption is: pick a script, download it, execute it against your server. There is nothing to compile and nothing to version-resolve, which is the strongest argument for the design. A DBA can read the whole thing before running it, and there is no transitive dependency graph to audit.
The same simplicity produces the gap. Nothing in the readme describes removing what the scripts create. The aggregate installer creates stored procedures, tables and scheduled jobs, and jobs in particular live outside any single database, so removing them is a different operation from removing the procedures. There is no uninstall script, no documented teardown procedure, and no mention of a downgrade path.
That matters in a specific operational situation. If you install this, change your mind, or need to move to a different maintenance approach, you are left inferring the object list from the create statements. The readme names what gets created but not how to reverse it.
The version-control attributes file is a small thing worth noting for Windows administrators, since these scripts get downloaded and run on Windows and the file governs line-ending normalisation for exactly that case.
Editorial conclusion
This solution suits an administrator who wants the well-known community scripts rather than the built-in maintenance plan wizard, and the object list is small enough to read in full before running anything. Four things to establish first. Which aggregate script you need, because the on-premises one creates scheduled jobs and the Azure SQL Database one creates only three maintenance objects with no jobs at all. Which version you have, since there are no GitHub releases and the version history lives on a website rather than in the tree, so the checksums tell you a file is unmodified but not that a set of files shares a release. How you deploy, because there is no build step and no package, only scripts you execute against a server. And how you would undo it, since nothing in the repository describes removing the procedures, tables or the scheduled jobs it creates. Read the dependency rule about updating four files together before your first upgrade.
Frequently asked questions
How to perform database maintenance?
With the three stored procedures this solution provides: one to back up databases, one to check their integrity, and one to rebuild and reorganise indexes and update statistics. The aggregate installer creates those plus the tables and scheduled jobs they need, and it covers SQL Server 2017, 2019, 2022 and 2025 along with Azure SQL Managed Instance. A separate installer for Azure SQL Database creates only the integrity check and index and statistics objects.
How can I repair a corrupted SQL database?
This repository checks integrity rather than repairing. The relevant object is a stored procedure described as checking the integrity of databases, and nothing in the repository describes a restore or repair procedure for corruption. Recovery from corruption is a different operation from an integrity check and is not covered here.
Which SQL Server versions does sql-server-maintenance-solution support?
The aggregate script is listed for SQL Server 2017, 2019, 2022 and 2025, plus Azure SQL Managed Instance, and it creates all the objects and jobs needed. The separate Azure SQL Database script creates only the integrity check and index and statistics maintenance objects, with no jobs. No version below 2017 is listed.
What are the dependencies between the sql-server-maintenance-solution scripts?
CommandExecute is always required, because DatabaseBackup, DatabaseIntegrityCheck and IndexOptimize all use it, and the readme states that updating any of those three means updating CommandExecute as well. CommandLog is needed only if you use the option to log commands to a table. Queue and QueueDatabase are both described as tables for processing databases in parallel, and the readme does not explain how the two differ.
How do I tell which version of sql-server-maintenance-solution I am running?
The repository publishes no GitHub releases and keeps its version history on the project website rather than in the tree, so there is no tag to pin. It does ship a SHA-256 checksum file, which lets you confirm a downloaded script is unmodified, but the checksums do not tell you whether several files came from the same release, which matters because four of them must be updated together.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/olahallengren-sql-server-maintenance-solution)Star history chart for your README
[](https://hysenlabs.com/projects/olahallengren-sql-server-maintenance-solution)Was this useful?