Version History
19 July 2026
Updated the logging of parameters in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize. Parameters are now logged one per line, for easier readability and to ensure that the logging is not truncated.
18 July 2026
Added a check to determine whether a full or differential backup is in progress before promoting a log backup. The check only runs in SQL Server 2022 CU26 and later, in SQL Server 2025 CU7 and later, and in Azure SQL Managed Instance.
Optimized performance in IndexOptimize by adding pre-filtering of exclusions in the @Indexes parameter.
15 July 2026
Optimized performance in IndexOptimize by reducing calls to sys.dm_db_incremental_stats_properties.
14 July 2026
Optimized performance in IndexOptimize by adding pre-filtering when using the @Indexes parameter.
12 July 2026
Added support for excluding databases from log backups while they are being seeded, using the parameter @ExcludeSeedingFromLogBackup = 'Y'.
7 July 2026
Optimized performance in IndexOptimize by adding pre-filtering on the page count when using the parameters @MinNumberOfPages and @MaxNumberOfPages.
28 June 2026
Optimized performance in IndexOptimize by executing sub-queries at the right level, for example at the object or index level rather than at the partition level.
20 June 2026
Fixed an issue with NOINDEX for DBCC CHECKALLOC.
8 June 2026
Added support for DATA_COMPRESSION for index rebuilds.
7 June 2026
Added support for PERSIST_SAMPLE_PERCENT with the @StatisticsPersistSample parameter.
6 June 2026
Masked encryption keys for Quest LiteSpeed for SQL Server, Red Gate SQL Backup Pro, and Idera SQL Safe Backup.
31 May 2026
Changed DatabaseBackup to not allow non-copy-only backups on a distributed availability group forwarder by default. This prevents backups in the secondary availability group from interfering with the backup chain in the primary availability group. Set @AllowNonCopyOnlyBackupsOnForwarder = 'Y' to allow them.
30 May 2026
Added support for no table output with Dell EMC Data Domain Boost using @DataDomainBoostNoOutputTable = 'Y'.
Improved support for online index rebuilds on Azure SQL Database and Azure SQL Managed Instance.
Added support for backup using the ZSTD compression algorithm in Azure SQL Managed Instance with the SQL Server 2025 or Always-up-to-date update policy.
Renamed the parameters @ModificationLevel, @LogSizeSinceLastLogBackup, and @TimeSinceLastLogBackup in DatabaseBackup to @MinModificationLevel, @MinLogSizeSinceLastLogBackup, and @MinTimeSinceLastLogBackup. MaintenanceSolution.sql changes any jobs to the new parameter names.
28 May 2026
Added support for distributed availability groups.
25 May 2026
Fixed an issue with backup on secondary replicas in Standard Edition.
24 May 2026
Fixed an issue with backup of the master database with contained availability groups.
Added @NoInformationalMessages = 'Y' to the DatabaseIntegrityCheck jobs in MaintenanceSolution.sql.
23 May 2026
Fixed an issue with online index rebuilds when page locks are disabled.
22 May 2026
Fixed an issue with updating statistics on newly created tables.
20 May 2026
Improved diagnostics for cleanup of backup files.
18 May 2026
Fixed an issue with CHECKCATALOG on availability group secondaries.
Fixed an issue with IndexOptimize on indexed views.
15 May 2026
Fixed an issue with resumable index rebuilds and the timestamp data type.
Fixed an issue with resumable index rebuilds and computed columns.
13 May 2026
Replaced variable self-concatenation with STRING_AGG. The minimum required version is now SQL Server 2017. If you’re on SQL Server 2008-2016, you can download the last supported version.
4 April 2026
Added support for backup encryption in SQL Server 2025 Standard Developer Edition.
20 December 2025
Added support for SQL Server 2025.
23 August 2025
Fixed an issue where log backups were not excluded for databases configured for log shipping.
Added support for backup compression in SQL Server 2025 Standard Developer Edition.
22 July 2025
Improved logging of backups on secondary replicas. It now logs "Is backup operation supported on secondary replicas" to make troubleshooting easier.
19 July 2025
Improved version check logic for online index rebuilds in IndexOptimize.
Added logging of the availability group database replica’s synchronization state and synchronization health.
17 July 2025
Added support for non-copy-only full and differential backups on secondary replicas in SQL Server 2025.
14 June 2025
Changed to use sys.dm_os_file_exists instead of xp_fileexist on SQL Server 2017 and later. Please note that sys.dm_os_file_exists requires read-attributes permission on all ancestor directories in the path, not only the target directory as with xp_fileexist.
9 June 2025
Fixed an issue with incorrect version check for online rebuild of indexes on tables with columnstore indexes.
24 May 2025
Added support for ZSTD compression in SQL Server 2025.
Introduced the @CompressionLevel parameter for specifying compression levels (LOW, MEDIUM, HIGH).
Introduced the @CompressionLevelNumeric parameter for third-party backup tools that use numeric compression levels.
The @CompressionLevel parameter previously used for third-party tools has been replaced with @CompressionLevelNumeric. Users of third-party backup software need to update their scripts accordingly.
26 April 2025
Removed check against sys.dm_exec_requests in DatabaseBackup.
19 February 2025
Fixed an issue with reorganizing indexes in IndexOptimize.
16 February 2025
Added support for specifying a backup set name when using Dell EMC Data Domain Boost.
15 February 2025
Added a script to MaintenanceSolution.sql that updates the backup job parameters from @CheckSum to @Checksum.
12 February 2025
Fixed an issue when backing up databases in availability groups to Dell EMC Data Domain Boost.
Fixed an issue with DatabaseIntegrityCheck and IndexOptimize on Azure SQL Database.
Fixed an issue with DatabaseIntegrityCheck on the rdsadmin database on AWS RDS.
9 February 2025
Fixed an issue with MAX_DURATION and RESUMABLE.
Fixed an issue with updating column statistics on a table where the clustered index is disabled.
Fixed an issue where clustered and nonclustered indexes are rebuilt offline, if there is a columnstore index on the table.
Added support for online rebuild of columnstore indexes.
8 February 2025
Improved support for availability groups with Data Domain Boost.
Fixed an issue with IndexOptimize on the rdsadmin database on AWS RDS.
Fixed an issue with resumable index operations on Azure SQL Database and Azure SQL Managed Instance.
Fixed an issue with @ExecuteAsUser on non-readable secondary replicas.
28 January 2025
Added support for EXPIREDATE in DatabaseBackup.
Added support for RETAINDAYS in DatabaseBackup.
26 January 2025
Fixed an issue in IndexOptimize with memory-optimized tables.
18 January 2025
Implemented workaround in IndexOptimize for an issue when querying sys.dm_db_index_physical_stats in the model database on Azure SQL Managed Instance.
15 January 2025
Fixed an issue in IndexOptimize with computed columns in the clustered index when using RESUMABLE.
Implemented workaround in IndexOptimize for an issue when querying sys.dm_db_index_physical_stats in the master database on Azure SQL Managed Instance.
14 January 2025
Fixed an issue in IndexOptimize with updating incremental statistics when NORECOMPUTE is set.
13 January 2025
Fixed an issue in IndexOptimize with filtered indexes and @Resumable = 'Y'.
12 January 2025
Changed the default value of @NoInformationalMessages to N in DatabaseIntegrityCheck to align with native SQL Server commands.
Fixed an issue in IndexOptimize when running with @PartitionLevel = 'N'.
7 January 2025
Added a new parameter @MinDatabaseSizeForDifferentialBackup to dynamically change the backup type for databases smaller than this size to full backup.
Optimized performance in DatabaseBackup for a large number of databases.
Added support for specifying a backup set name.
Added support for a new token Weekday for directory structure and file name.
Added support for cleanup when the BackupType is not in the directory structure.
Added a check to determine whether a full or differential backup is in progress before promoting a log backup.
Added a new parameter @NoInformationalMessages to DatabaseIntegrityCheck.
4 January 2025
Renamed the parameter in DatabaseBackup from @CheckSum to @Checksum. If you are using a case-sensitive instance, you will need to update your jobs. The February 15, 2025 release includes a script in MaintenanceSolution.sql that handles this automatically.
Added support for specifying the STATS option in DatabaseBackup.
Changed logic to only create subdirectories if they do not exist.
27 December 2024
Changed logic to skip databases in single user mode (as a number of users have reported issues with this).
14 December 2024
Fixed an issue with cleanup of old backup files before backup on Linux.
24 November 2024
Fixed an issue with backup @Directory = '/backup' on Linux.
Fixed an issue with cleanup of old backup files on Linux.
Fixed an issue with the version check for @DatabaseOrder = 'DATABASE_LAST_GOOD_CHECK_ASC' on Azure SQL Managed Instance.
Fixed an issue with CHECKTABLE on tables with single quotes in the table name.
Fixed an issue with server name check in DatabaseIntegrityCheck on case-sensitive instances.
23 November 2024
Added support for backup to URL when creating jobs using MaintenanceSolution.sql.
21 November 2024
Added support for specifying the case in the directory structure and file name.
Added support for UTC time in the tokens used in the directory structure and file name.
18 November 2024
Fixed an issue with server name check in DatabaseBackup on case-sensitive instances.
14 November 2024
Added support for QAT backup compression using @CompressionAlgorithm = 'QAT_DEFLATE'.
12 November 2024
Fixed an issue with emojis in database names.
Fixed an issue with the version check for backup encryption on Azure SQL Managed Instance.
27 October 2024
Added support for backup to AWS S3 storage.
Added support for backup to Azure Blob Storage using Managed Identity.
2 January 2022
Fixed an issue in DatabaseBackup with databases in standby mode.
Improved error messages in DatabaseBackup.
31 December 2021
Fixed an issue with performance when backing up large databases.
Fixed an issue with backup to URL (page blobs) with compression when the database has TDE enabled.
Fixed an issue with performing consistency checks of databases in emergency mode.
30 December 2021
Changed so that xp_create_subdir is only executed when subdirectories are created.
Added a parameter, @DirectoryCheck, to control whether it should be checked if the root directory exists.
31 December 2020
Changed so that MAXTRANSFERSIZE is not added automatically for databases with TDE, on SQL Server 2019 CU5 and later.
6 December 2020
Fixed an issue with CHECKFILEGROUP and CHECKTABLE on secondary replicas.
5 December 2020
Added BACKUP_PROMOTION=NONE, when using Data Domain Boost.
29 November 2020
IndexOptimize: Added support for changing the execution context to any user.
28 November 2020
IndexOptimize: Added support for changing the execution context to the user dbo.
Added a token for Week in DatabaseBackup.
26 November 2020
Optimized performance of availability group checks.
Fixed an issue with read-only databases when using Data Domain Boost.
21 November 2020
Added a parameter to exclude databases configured for log shipping from log backups.
15 November 2020
Fixed an issue with backup compression on Azure SQL Database Managed Instance.
1 November 2020
Fixed an issue with using the default backup directory on Linux.
25 October 2020
Added support for cleanup of old backup files on Linux.
Added support for backup to NUL on Linux.
26 January 2020
Added a parameter for the option DATA_PURITY.
11 January 2020
Fixed an issue where the stored procedures reported an error if you specify a database that does not exist.
9 January 2020
Added support for specifying a minimum size for when DatabaseBackup should back up to multiple files. The parameter for this is @MinBackupSizeForMultipleFiles.
Added support for dynamically calculating the number of backup files, based on a parameter for the maximum file size. The parameter for this is @MaxFileSize.
8 January 2020
Added support for specifying a string delimiter.
6 January 2020
Fixed an issue with integrity checks against secondary replicas.
5 January 2020
Removed support for SQL Server 2005.
31 December 2019
Fixed an issue with deadlocks when you are processing databases in parallel.
Changed to use sp_executesql in CommandExecute.
30 December 2019
Changed so that MAXTRANSFERSIZE is automatically set to 65537, for databases with TDE, when performing backup with compression in SQL Server 2016 and later.
29 December 2019
Added support for generating an Object Level Recovery Map when using LiteSpeed.
Fixed an issue with database_id in IndexOptimize when running on Azure SQL Database.
26 December 2019
Added support for SQL Server 2019.
Added support for the option FORMAT in DatabaseBackup.
14 June 2019
Added support for backup to NUL.
10 June 2019
Changed so that the Distribution database is considered a system database.
9 June 2019
Changed to use sys.databases instead of DATABASEPROPERTYEX.
7 June 2019
Changed to use the SQL Server Agent tokens DATE and TIME in output files.
22 May 2019
Added a {NumberOfFiles} token that can be used in file names.
Performance optimization in DatabaseBackup. In the new version sys.dm_db_file_space_usage is only checked when you are using the smart differential backup feature.
28 April 2019
Fixed an issue with failed backups when the cluster service on the secondary replica is not running.
10 February 2019
Fixed an issue when backing up using Data Domain Boost 4.7.
13 January 2019
Improved input parameter checking for mirrored backup in DatabaseBackup.
12 January 2019
Added empty lines in output files for T-SQL job steps.
11 January 2019
Added tokens for MajorVersion, MinorVersion, and Millisecond in DatabaseBackup.
6 January 2019
Fixed an issue with ALTER INDEX commands in IndexOptimize.
Changed so that a full backup is triggered if you perform a differential backup of the [master] database and are using @ChangeBackupType='Y'.
Changed so that a full backup is triggered if you perform a differential backup, the base differential LSN is a VSS backup, and you are using @ChangeBackupType='Y'.
Changed the severity from 16 to 10 for the check that databases, availability groups, filegroups, objects, and indexes exist.
5 January 2019
Changed to use the SQL Server Agent token JOBNAME in output files on SQL Server 2016 and later.
1 January 2019
Added support for striping to multiple storage accounts when backing up to URL.
Improved performance of IndexOptimize.
30 December 2018
Fixed an issue with % in database names.
29 December 2018
Added support for smart differential backup in SQL Server 2014 SP3.
Added support for smart transaction log backup in SQL Server 2014 SP3.
Added support for setting MAXDOP when updating statistics in SQL Server 2014 SP3.
Added support for @DatabaseOrder = 'LOG_SIZE_SINCE_LAST_LOG_BACKUP_ASC' and @DatabaseOrder = 'LOG_SIZE_SINCE_LAST_LOG_BACKUP_DESC' in DatabaseBackup in SQL Server 2014 SP3.
Added support for @DatabaseOrder = 'DATABASE_LAST_GOOD_CHECK_ASC' and @DatabaseOrder = 'DATABASE_LAST_GOOD_CHECK_DESC' in DatabaseIntegrityCheck in SQL Server 2014 SP3.
Fixed a bug with backup to URL on case-sensitive instances.
Changed to allow leading spaces in database names.
Fixed an issue with ALTER INDEX commands in IndexOptimize in SQL Server 2005.
28 October 2018
Fixed a bug with database order when you are using the option @DatabasesInParallel = 'Y'.
16 July 2018
Added a check that the database where you are creating the objects is in compatibility level 90 or higher.
Added a check that ANSI_NULLS is set to ON for CommandExecute, DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
Added a check that QUOTED_IDENTIFIER is set to ON for CommandExecute, DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
27 June 2018
Added support for mirrored backup to URL.
24 June 2018
Added support for setting the severity for lock timeouts and deadlocks in IndexOptimize. Use the parameter @LockMessageSeverity.
23 June 2018
Added support for @DatabaseOrder = 'DATABASE_LAST_GOOD_CHECK_ASC' and @DatabaseOrder = 'DATABASE_LAST_GOOD_CHECK_DESC' in DatabaseIntegrityCheck in SQL Server 2017 CU8.
20 June 2018
Added support for processing multiple databases in parallel. You can do this by creating multiple jobs with the same parameters, and adding the parameter @DatabasesInParallel = 'Y'.
Added support for doing transaction log backup in the order of log_since_last_log_backup_mb in sys.dm_db_log_stats. Use the parameter @DatabaseOrder.
18 June 2018
Fixed an issue with "Invalid object name 'sys.master_files'." on Azure SQL Database.
16 June 2018
Added support for specifying a percentage of modified rows for when the statistics should be updated. Use the parameter @StatisticsModificationLevel.
Added support for doing checkdb in the order of when the databases were last checked. Use the parameter @DatabaseOrder.
Added a @TimeLimit parameter in DatabaseIntegrityCheck.
Added support for doing consistency checks on the preferred backup replica.
15 June 2018
Fixed an issue with "The length of the device name provided exceeds supported limit (maximum length is:259)".
11 June 2018
Fixed an issue with online resumable index rebuilds.
Changed the default backup directory in MaintenanceSolution.sql from 'C:\Backup' to NULL. NULL is the default backup directory for the SQL Server instance.
10 June 2018
Added a version timestamp in the header of the stored procedures. Here is a script that you can use to check the version timestamps.
9 June 2018
Added support for online resumable index rebuilds. Use the parameter @Resumable.
Added support for the option INIT in DatabaseBackup.
6 June 2018
Added support for incremental statistics. It will automatically update statistics on the partition level for incremental statistics, if you have @PartitionLevel = 'Y' (which is the default).
5 June 2018
Fixed an issue with "Arithmetic overflow error converting expression to data type int." in IndexOptimize.
3 June 2018
Improved logging when updating statistics.
2 June 2018
Fixed an issue when backing up to Azure SQL Database Managed Instance.
1 June 2018
Added support for setting the maximum number of pages in IndexOptimize. Use the parameter @MaxNumberOfPages.
Changed the name of the parameter @PageCountLevel to @MinNumberOfPages. If you are using @PageCountLevel in your jobs you need to change to @MinNumberOfPages.
Added the directory and file name token {Description}.
30 May 2018
Added support for clusterless availability groups.
28 May 2018
Added support for specifying the database order. You do that by using the @Databases parameter. It works the same in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
Fixed an issue with the error "Cannot specify partition number in the alter index statement as the index is not partitioned" in IndexOptimize.
23 May 2018
Added support for a configurable directory structure. Use the parameters @DirectoryStructure and @AvailabilityGroupDirectoryStructure.
Changed default behavior when you are backing up to URL: You will now get a directory structure (same as when you are backing up to disk). To back up directly to the URL, you can set @DirectoryStructure = NULL and @AvailabilityGroupDirectoryStructure = NULL.
Added support for configurable file names. Use the parameters @FileName and @AvailabilityGroupFileName.
Added support for configurable file extensions. Use the parameters @FileExtensionFull, @FileExtensionDiff, and @FileExtensionLog.
21 May 2018
Fixed an issue with the @@SERVERNAME check in DatabaseBackup.
13 May 2018
Changed script encoding to UTF-8.
10 May 2018
Added support for Dell EMC Data Domain Boost.
28 April 2018
Fixed an issue when running on Azure SQL Database.
27 April 2018
Added support for Azure SQL Database Managed Instance.
24 April 2018
Added support for smart differential backup in SQL Server 2016 SP2.
Added support for smart transaction log backup in SQL Server 2016 SP2.
Added support for setting MAXDOP when updating statistics in SQL Server 2016 SP2.
20 April 2018
Fixed a bug with smart differential backup and availability groups.
Changed to T-SQL jobs for SQL Server 2012 and later.
13 April 2018
Added support for smart differential backup in SQL Server 2017. Use the parameters @ChangeBackupType and @ModificationLevel.
Added support for smart transaction log backup in SQL Server 2017. Use the parameters @LogSizeSinceLastLogBackup and @TimeSinceLastLogBackup.
12 April 2018
Added support for setting MAXDOP when updating statistics in SQL Server 2017.
9 April 2018
Added support for Linux and Amazon RDS in the job creation in MaintenanceSolution.sql.
5 April 2018
Added the LiteSpeed option @AdaptiveCompression in DatabaseBackup.
2 April 2018
Fixed an issue with the input parameter checking for the @Indexes parameter.
Improved output from stored procedures, when executed from SQL Server Agent T-SQL jobs.
31 March 2018
Added support for backup on SQL Server on Linux.
30 March 2018
Fixed an issue with the keyword AVAILABILITY_GROUP_DATABASES.
Changed the scripts so that they first create a stub if the stored procedure does not exist, and then alter the stored procedure.
28 March 2018
Added support for striping of backups to Azure Blob Storage.
Added support for MAXTRANSFERSIZE when backing up to Azure Blob Storage.
Added support for BLOCKSIZE when backing up to Azure Blob Storage.
27 March 2018
Improved input parameter checking for @Databases, @AvailabilityGroups, @FileGroups, @Objects, and @Indexes.
Added a check in DatabaseBackup that @@SERVERNAME is the same as SERVERPROPERTY('ServerName'). The check is only performed if Always On is enabled. The background for this is that sys.fn_hadr_backup_is_preferred_replica is not working correctly if @@SERVERNAME is not correct.
22 March 2018
Added a check for suspect databases in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
21 March 2018
Fixed an issue with consistency checks on databases in availability groups in Standard Edition.
20 March 2018
Improved input parameter checking for @MaxTransferSize in DatabaseBackup.
2 October 2017
Added support for SQL Server 2017.
7 October 2016
Fixed a bug in DatabaseIntegrityCheck and IndexOptimize when running on Azure SQL Database.
6 October 2016
Fixed a collation conflict that occurred when creating the objects in a database with a collation other than the one in tempdb.
2 October 2016
Added support for selecting availability groups in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize, using a new parameter, @AvailabilityGroups.
Added a new keyword, AVAILABILITY_GROUP_DATABASES in the @Databases parameter in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
Added support for selecting READ_ONLY/READ_WRITE databases in DatabaseBackup and DatabaseIntegrityCheck.
28 September 2016
Changed the way spaces in database names are handled in directory names and file names in DatabaseBackup. Before, all spaces in the database name were removed. Now only leading and trailing spaces are removed.
25 September 2016
Improved handling of databases with Transparent Data Encryption (TDE) together with backup compression. If you have databases with TDE in SQL Server 2014 and earlier, backup compression is not used. If you have databases with TDE in SQL Server 2016, backup compression is used if MAXTRANSFERSIZE is greater than 65536. You can read more in this SQLCAT blog post.
Added support for shared access signatures when backing up to Azure Blob Storage.
Added an option to control which replicas in availability groups should be checked in DatabaseIntegrityCheck.
Fixed an issue with updating of statistics on memory-optimized tables in SQL Server 2016.
Changed so that line breaks are allowed when selecting databases, indexes, filegroups, objects, and directories.
22 September 2016
Added support for the option MAXDOP in DatabaseIntegrityCheck.
20 June 2016
Added support for SQL Server 2016.
19 July 2015
Fixed an issue with IndexOptimize when running on Azure SQL Database.
25 January 2015
Added support for integrity check on Azure SQL Database.
26 December 2014
Added support for index and statistics maintenance on Azure SQL Database.
30 November 2014
Added support for checking the integrity of tempdb.
24 November 2014
Added support for deleting old backup files, before the backup is performed.
31 October 2014
Added support for mirrored backup.
6 October 2014
Improved input parameter checking for certificates and asymmetric keys.
5 October 2014
Added support for backup to Azure Blob Storage.
4 October 2014
Added support for the option NORECOVERY in DatabaseBackup.
Fixed an issue with DBCC CHECKFILEGROUP and memory-optimized filegroups.
Fixed an issue with DBCC CHECKTABLE and memory-optimized tables.
Fixed an issue with the option READ_WRITE_FILEGROUPS and the master database.
24 March 2014
Added support for updating of statistics on memory-optimized tables in SQL Server 2014.
22 March 2014
Added support for backup encryption in SQL Server 2014.
Added support for low priority lock wait options for online index rebuilds in SQL Server 2014.
19 March 2014
Added support for SQL Server 2014.
Changed to use the SQL Server Agent token SQLLOGDIR for output files.
Changed the @CleanupTime parameter in the backup jobs (new jobs only) in MaintenanceSolution.sql from 24 (24 hours) to NULL (no files are deleted).
18 March 2014
Fixed an issue with cleanup of backup files. If you were using availability groups, and did full and differential backups on the primary replica, and transaction log backups on the secondary replica, and there has been a failover, then cleanup of transaction log backup files was not working.
23 February 2014
Fixed an issue with DatabaseIntegrityCheck and IndexOptimize when running on Amazon RDS.
16 February 2014
Changed name of the parameter @EncryptionType to @EncryptionAlgorithm.
Changed name of encryption algorithms, from AES-128 to AES_128, and from AES-256 to AES_256.
Removed support for Red Gate SQL HyperBac.
12 February 2014
Fixed an issue with cleanup of backup files. If you were using availability groups, and did full and differential backups on the primary replica, and transaction log backups on the secondary replica, then cleanup of transaction log backup files was not working.
7 February 2014
Fixed an issue with rebuilding indexes on views and computed columns.
31 January 2014
Added support for online rebuild of partitions in SQL Server 2014.
Changed default for the @PartitionLevel parameter to 'Y'.
19 January 2014
Removed edition check for the @PartitionLevel parameter. On Standard Edition it will work the same as if it were Enterprise Edition, and no tables were partitioned.
23 December 2013
There is an issue in SQL Server with rebuilding an index online, if the index does not have ALLOW_PAGE_LOCKS enabled (kb article 2292737). The issue is that if you use multiple CPUs, the index will become more fragmented when you rebuild it. If IndexOptimize runs into this situation it changes the max degree of parallelism to 1 for that index. I have changed the workaround so that it applies to all versions.
22 September 2013
Optimized the cleanup of backup files.
12 September 2013
Improved handling for an issue in which a database exceeded the maximum length for a backup device.
2 September 2013
Added logging of backup preference for availability groups.
15 June 2013
Changed to use SERVERPROPERTY to get the SQL Server error log directory.
9 June 2013
Added support for overriding the backup preference for availability groups.
23 May 2013
Fixed an issue with disabled columnstore indexes in IndexOptimize.
19 May 2013
Added support for indexes and statistics on objects that are created by internal SQL Server components.
Optimized performance in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize when selecting a large number of databases.
30 April 2013
Added support for setting the LOCK_TIMEOUT in DatabaseIntegrityCheck and IndexOptimize. The LOCK_TIMEOUT is not set by default.
17 March 2013
Added support for setting the maximum transfer size in Red Gate SQL Backup.
2 March 2013
Fixed an issue in which IndexOptimize did not return the correct return code.
17 February 2013
Optimized performance in DatabaseBackup for servers with a large number of databases.
4 February 2013
Changed to use path in sys.dm_os_server_diagnostics_log_configurations to get the SQL Server error log directory.
12 January 2013
Changed error messages in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
8 January 2013
Moved the code that selects databases into the stored procedures DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize.
5 January 2013
Fixed an issue in which transaction log backups were not deleted when the last full or differential backup was a copy_only backup.
28 December 2012
Changed IndexOptimize to check modification_counter in sys.dm_db_stats_properties, to determine whether any rows have been modified since the most recent statistics update.
26 November 2012
Changed the behavior in DatabaseBackup so that databases that are set up for log shipping are skipped when you perform log backups.
28 October 2012
Fixed a locking issue with IndexOptimize when running multiple sessions in parallel.
4 September 2012
Fixed an issue with backup compression in SQL Server 2012 Business Intelligence Edition.
1 September 2012
Fixed an issue with performing a differential backup of a database with no full backup in SQL Server 2005.
29 July 2012
Added a check for columnstore indexes in IndexOptimize.
8 July 2012
Added support for striping of backups across multiple drives.
1 July 2012
Added support for check of filegroups in DatabaseIntegrityCheck.
Added support for check of tables and indexed views in DatabaseIntegrityCheck.
Added support for check of disk space allocation structures in DatabaseIntegrityCheck.
Added support for check of catalog consistency in DatabaseIntegrityCheck.
30 June 2012
Changed the maximum compression level for LiteSpeed from 10 to 8.
22 June 2012
Added support for the READ_WRITE_FILEGROUPS option in DatabaseBackup.
17 June 2012
Fixed an issue with a deadlock that occurred when querying the catalog view sys.database_recovery_status in SQL Server 2012.
20 May 2012
Changed the way backup of availability groups works. Full (non-copy-only) and differential backups are performed on the primary replica. Full copy-only backups and transaction log backups are performed on the preferred replica.
Added logging of availability groups and availability group roles.
Added cluster name and availability group name to the backup directory and filename, for databases in availability groups.
14 April 2012
Added support for backing up preferred replicas in SQL Server 2012 AlwaysOn Availability Groups.
10 March 2012
Added support for SQL Server 2012.
Added support for online rebuilding of indexes with varchar(max), nvarchar(max), varbinary(max), or XML data types or large CLR types in SQL Server 2012.
12 February 2012
Added support for deleting old output files on international versions of Windows.
30 December 2011
Added support for specifying an output file directory in MaintenanceSolution.sql.
Added support for specifying @LogToTable in MaintenanceSolution.sql.
17 December 2011
Fixed an issue with the job that deletes old output files.
26 November 2011
Fixed an issue that occurred when deleting encrypted Red Gate SQL Backup backup files.
23 October 2011
Added support for backup encryption that uses LiteSpeed for SQL Server, Red Gate SQL Backup and SQL HyperBac, or Idera SQL Safe Backup.
17 October 2011
Fixed an issue with rebuilding indexes on views of databases in compatibility level 80.
4 September 2011
Improved the checking of output filenames when creating jobs.
24 August 2011
Improved the checking of the @LogToTable parameter.
21 August 2011
Changed the command type for transaction log backups to BACKUP_LOG.
11 August 2011
The table CommandLog is now created in MaintenanceSolution.sql.
Added a job for deleting old rows in CommandLog.
8 August 2011
Fixed an issue in which blank lines were not displayed when executing the stored procedures in SQL Server Management Studio.
4 August 2011
Added COPY_ONLY to backup directory and filename.
Added support for deleting old backup files when performing COPY_ONLY backups.
1 August 2011
Modified a download link to one of the backup-application vendors.
31 July 2011
Aligned the positions of the @FragmentationLow, @FragmentationMedium, and @FragmentationHigh parameters with the @FragmentationLevel1 and @FragmentationLevel2 parameters. If you are passing the parameters to the stored procedure by name (recommended), this change will not affect you.
30 July 2011
Added download links to error messages if you select a backup application that is not installed.
9 July 2011
Added support for logging commands to a table by using the @LogToTable parameter.
18 June 2011
Jobs are now created under the [Database Maintenance] category.
15 May 2011
Optimized performance in IndexOptimize for databases with a large number of indexes.
4 March 2011
Added handling for an issue in which a database with a very long name exceeded the maximum length for a backup device.
Added support for the TABLOCK option in DatabaseIntegrityCheck.
20 January 2011
Added support for Idera SQL Safe Backup.
16 January 2011
Added support for a delay between index commands in IndexOptimize.
8 January 2011
Added @FragmentationHigh, @FragmentationMedium, and @FragmentationLow parameters for defining your preferred index maintenance.
Added the @UpdateStatistics parameter for updating statistics.
25 December 2010
Added support for setting the number of threads in LiteSpeed for SQL Server and Red Gate SQL Backup.
Added support for setting the maximum CPU usage in LiteSpeed for SQL Server.
9 December 2010
Added support for updating column statistics.
Added support for updating statistics only when the data has been modified. Set @OnlyModifiedStatistics = 'Y' to use this option.
Added support for updating statistics by using the RESAMPLE option. Set @StatisticsResample = 'Y' to use this option.
Added support for updating statistics using NORECOMPUTE on statistics that are disabled for auto-update.
Optimized performance in IndexOptimize. It now queries the DMV sys.dm_db_index_physical_stats only if needed.
12 September 2010
Added support for the PAD_INDEX option in IndexOptimize.
15 August 2010
Improved error handling in IndexOptimize, in situations when the query that selects indexes from the system tables is blocked.
3 August 2010
Added support for selecting schemas, objects, and indexes in IndexOptimize.
21 July 2010
Added support for creating a backup description.
20 July 2010
Added support for Red Gate SQL HyperBac backup compression.
Changed the file extension for Red Gate SQL Backup backups; the SQL Backup default file extension .sqb is now used.
Changed the behavior for COPY_ONLY backups; deleting old backup files when you’re performing a COPY_ONLY backup is no longer supported.
30 May 2010
Fixed a collation conflict that occurred when creating the objects in a database with a collation other than the one in tempdb.
23 May 2010
Changed the default for backup compression. The compression default in sys.configurations is now used.
16 May 2010
Added a job for purging job history, using the stored procedure sp_purge_jobhistory.
Added a job for purging backup history, using the stored procedure sp_delete_backuphistory.
Added a job for deleting output files.
15 May 2010
Added a workaround for an issue in SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2, in which fragmentation sometimes remains in an index that has page locking disabled, when you use multiple CPUs to rebuild the index online. The workaround is in IndexOptimize setting MAXDOP = 1, when you rebuild an index that has page locking disabled online.
14 May 2010
DatabaseBackup now supports backup compression in SQL Server 2008 R2 Standard Edition.
26 April 2010
Added support for SQL Server 2008 R2.
5 December 2009
Added support for setting the compression level when you use LiteSpeed for SQL Server or Red Gate SQL Backup.
21 November 2009
Added support for backing up to multiple files.
Added support for Red Gate SQL Backup.
13 November 2009
Added support for the BLOCKSIZE option in DatabaseBackup.
Added support for the BUFFERCOUNT option in DatabaseBackup.
Added support for the MAXTRANSFERSIZE option in DatabaseBackup.
22 August 2009
Added support for selecting all databases: @Databases = 'ALL_DATABASES'.
Added support for databases in single-user mode.
Added a check in DatabaseBackup to determine whether database names are unique in the file system.
6 August 2009
Added the @TimeLimit parameter in IndexOptimize. Use this parameter to set the time in seconds, after which no commands are executed.
1 August 2009
Added support for the EXTENDED_LOGICAL_CHECKS option in DatabaseIntegrityCheck.
Added support for the CHECKSUM option in DatabaseBackup.
Added support for a default backup directory in DatabaseBackup.
Added a check for databases in standby mode in DatabaseBackup.
20 June 2009
Changed the behavior in DatabaseBackup so that when deleting old log backups, the procedure doesn’t delete any log backups that are newer than the most recent full or differential backup.
6 June 2009
Added support for printing commands without executing them. Set the new @Execute parameter to 'N' to use this option.
21 May 2009
Added support for rebuilding and reorganizing partitioned indexes on the partition level. Set the new @PartitionLevel parameter to 'Y' to use this option.
10 May 2009
Added support for LiteSpeed for SQL Server backup.
Added the ability to exclude indexes on read-only file-groups in IndexOptimize.
16 April 2009
Added support for XML indexes.
Added support for spatial indexes.
Added support for indexed views.
Added a check for large CLR types in IndexOptimize.
Added a check for indexes with page locking disabled in IndexOptimize.
1 March 2009
Added support for the COMPRESSION option in DatabaseBackup.
Added support for the COPY_ONLY option in DatabaseBackup.
Added a check to determine whether a differential backup can be done, before performing a differential backup in DatabaseBackup.
Added a check to determine whether a transaction log backup can be done, before performing a transaction log backup in DatabaseBackup.
Added the default parameter value 'N' for backup verification in DatabaseBackup.
Added the default parameter value NULL for cleanup of old backups in DatabaseBackup.
Fixed an issue in DatabaseBackup in which non-Latin characters in the backup directory name generated an error.
Added support for the NOINDEX option in DatabaseIntegrityCheck.
Added support for the PHYSICAL_ONLY option in DatabaseIntegrityCheck.
DatabaseIntegrityCheck now uses the ALL_ERRORMSGS option to log all errors.
Added support for the MAXDOP option in IndexOptimize.
Added support for the SORT_IN_TEMPDB option in IndexOptimize.
Added support for the FILLFACTOR option in IndexOptimize.
Added support for the LOB_COMPACTION option in IndexOptimize.
Added support for the SAMPLE and FULLSCAN options in IndexOptimize.
Added support for the exclusion of disabled and hypothetical indexes in IndexOptimize.
Added support for the exclusion of read-only databases in IndexOptimize.
Added support for wild-cards in the database selection.
Added logging of duration for all commands.
Fixed an issue in which percent characters (%) in database, schema, table, or index names generated an error.
Fixed an issue in the installation script, in which SQL Server Agent check did not work in SQL Server Express.
2 August 2008
Added support for SQL Server 2008.
Added support for non-Latin characters in database, schema, object, and index names.
Added support for single quotes (') in schema, object, and index names.
Added support for case-sensitive databases.
Added support for characters in database names that are not allowed in the file system (\ / : * ? " < > |).
Added support for backing up to UNC paths.
Changed the behavior in DatabaseBackup so that databases that are in simple recovery model are skipped when you perform log backups.
Changed the behavior in DatabaseBackup, DatabaseIntegrityCheck, and IndexOptimize so that database snapshots are excluded.
Fixed an issue in IndexOptimize, in which a nonclustered index with a varchar(max), nvarchar(max), or varbinary(max) data type in an included column cannot be rebuilt online.
Improved error handling in IndexOptimize when the query that is checking the fragmentation is blocked.
Improved logging.
1 January 2008
This is the initial version of the SQL Server Maintenance Solution.