Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open Studio Management

  2. Click the 'New Query' button

  3. Then paste in the SQL below and select the appropriate database (typically named 'boss')

    Code Block
    USE BOSS --Enter the name of the database you want to reindex 
    DECLARE @TableName varchar(255) 
    DECLARE TableCursor CURSOR FOR 
    SELECT table_name FROM information_schema.tables
     WHERE table_type = 'base table'  
    OPEN TableCursor  
    FETCH NEXT FROM TableCursor INTO @TableName
      WHILE @@FETCH_STATUS = 0 
      BEGIN 
      DBCC DBREINDEX(@TableName,' ',90) 
      FETCH NEXT FROM TableCursor INTO @TableName
    
      END

  4. Update the database name in the query if its not ‘boss

  5. Execute
    Note: this query may take several minutes, wait until it's complete and then review invoices / the interface to determine if there is any performance improvement

...