Skip to content

Instantly share code, notes, and snippets.

@shaxxx
Created November 10, 2014 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaxxx/88cd9008fce27e645c8b to your computer and use it in GitHub Desktop.
Save shaxxx/88cd9008fce27e645c8b to your computer and use it in GitHub Desktop.
ReIndex all tables in MSSQL database
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
EXEC sp_updatestats
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment