Knowledge: SQL Reindex all tables in database
Back
    Title*SQL Reindex all tables in database
    ManualTroubleshooting
    Manual Level TwoServer
    Created12/08/2020
    Detail

    Most of the time reindexing of SQL is not required and often DBA's will run scripts anyway.  The below can be run to rebuild all indexes for a database.

    Exec sp_msforeachtable 'SET QUOTED_IDENTIFIER ON; ALTER INDEX ALL ON ? REBUILD'
    GO

    ManualManual Level Two
    InternalUseful SQL
    Privacy Policy
    Cookies help us to improve your user experience. By using this site you consent to cookies being stored on your device. Read more...
    View or hide all system messages