Indexing

Technical Article

DB Reindex all Databases

  • Script

This script reindexes all tables in all databases.  Execute the script with the desired fill factor and it will do the rest.  There is an option to exclude databases from the reindex. This makes it easy to reindex all newly created databases. Great for the Development environment when Developers are creating database all the time.

You rated this post out of 5. Change rating

2003-03-23

1,942 reads

Technical Article

Selective Defrag/Reindex and Log

  • Script

SQL 2000 OnlyThis script will create a stored procedure and a table in the master database. Simply run the stored procedure and supply a database name as a parameter. It will do the following:1. Gather/Log DBCC SHOWCONTIG statistics (pre defrag)2. Defragment all user indexes in the database3. Gather/Log DBCC SHOWCONTIG statistics (post defrag)4. DBCC DBREINDEX […]

5 (3)

You rated this post out of 5. Change rating

2010-04-19 (first published: )

2,217 reads

Technical Article

Dynamic DBCC DBREINDEX

  • Script

This script uses sysobjects and sysindexes to ID all tables in a database that are indexed, and/or clustered.  It then runs through per table all of the indexes and runs DBREINDEX with their fillfactor.  This eliminates having to maintain a list of all indexes and having code fail when it tries to modify indexes that […]

You rated this post out of 5. Change rating

2002-12-19

1,764 reads

Technical Article

Smart Index Manipulation system

  • Script

We are constantly having to drop indexesfrom tables while repopulating the datain the table. We then have to rebuild the indexes as they were before dropping them.This requires writing a custom drop and recreate index script for each unique situation. If we tryto write scripts ahead of time as soon as the indexing schemechanges on […]

You rated this post out of 5. Change rating

2002-08-06

949 reads

Technical Article

Index Locking Strategy

  • Script

This script returns the index locking strategy informationfor all user tables in a database. It also generates the required TSQL statement to alter locking strategies if required. These statements require CTRL-C and CTRL-V individually into query analyser for execution. Results are best viewed in text only. This TSQL can be wrapped in a stored procedure […]

4 (1)

You rated this post out of 5. Change rating

2002-07-04

1,383 reads

Blogs

SQL Training: Black Friday Deals Up to 75% Off

By

This Black Week, don't just get a discount—get ahead! Whether you're a total newbie...

When is the perfect moment to build a data strategy in a company?

By

The post When is the perfect moment to build a data strategy in a...

How to Run Databases on Kubernetes: An 8-Step Guide

By

In this step-by-step tutorial, learn how to run MySQL, PostgreSQL, MongoDB, and other stateful...

Read the latest Blogs

Forums

Learn Microsoft Fabric: A practical guide to performing data analytics in the era of artificial intelligence

By Site Owners

Comments posted to this topic are about the item Learn Microsoft Fabric: A practical...

Learn Microsoft Fabric: A practical guide to performing data analytics in the era of artificial intelligence

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Learn Microsoft Fabric: A practical...

Rebuild Index Job on a Large DB

By cooldude001

We have a db close to 3 tb and rebuilding/ reorganizing indexes weekly is...

Visit the forum

Question of the Day

Renaming a Database

If I want to rename the OldSales database to ArchiveSales, how can I do this? (choose 2)  

See possible answers