Indexing

Technical Article

Stabilize Index

  • Script

This sp is used to update index in a database.  This sp has got three optional varchar parameters.  First parameter will take the tablename. Second parameter will take the indexname.  Third parameter will take the fillfactor.  The following option we can execute the sp in a user database.1.    exec StabilizeIndexIt will update all index in […]

1 (1)

You rated this post out of 5. Change rating

2003-10-29

276 reads

Technical Article

Find Duplicate Indexes - Episode 1 (The Early SQL Versions)

  • Script

The excellent script contributed by G.R. Preethiviraj Kulasingham (Preethi) Sri Lanka (contributed 2/20/03, modified 5/22/03) identifies duplicate indexes for the database on which the script is run.  It requires User Defined Functions, a feature restricted to SQL Server 2000.This version achieves similar results without using UDFs or creating any other permanent objects. It therefore works […]

4 (1)

You rated this post out of 5. Change rating

2003-05-28

754 reads

Technical Article

Unattended Reindexing of all user tables

  • Script

I see scripts all the time on how to reindex all the tables in a db but they are usually too generic and may cause issues.  For instance they typically cause the log file to grow very large and may even fill the hard drive.  This is intended to be run off hours when db […]

You rated this post out of 5. Change rating

2003-04-24

638 reads

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,933 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,213 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,757 reads

Blogs

Build Recovery into the Design

By

It's like disaster recovery (and business continuity) planning is the end-of-term research paper that...

dataMinds Connect 2024 – Session Materials

By

The slides and scripts for my session “Tackling the Gaps & Islands Problem with...

Want to Supercharge Your Business? SQL is Your Secret Weapon.

By

Look, we all know data is king these days. But having mountains of data...

Read the latest Blogs

Forums

Log Backup failed on Secondary Replica

By aroojsql

I have a scenario where log backup is getting failed in Secondary replica on...

Everything is Code

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Everything is Code

Statistics Histograms

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Statistics Histograms

Visit the forum

Question of the Day

Statistics Histograms

I have a statistics objects with 2 key columns from my tables. How many histograms and their type are stored?

See possible answers