0

SQL: Rebuild Indexes, Update Statistics, and Shrink Databases on SQL Server

SQL to Rebuild Indexes, Update Statistics, and Shrink Databases

Here is SQL to Rebuild Indexes, Update Statistics, and Shrink Databases on SQL Server. This code works on SQL Server 2008 – 2016. It should help keeping your databases running at their peak performance. Just alter the settings as appropriate and away you go! Older legacy SQL2000 kept in for reference.