Indexing

Technical Article

Script to aid in Indexing Strategy

  • Script

When AUTOSTATS is used in a database, we can sometimes use these automatically generated statistics to find columns where SQL Server has built statistics on non-indexed columns that may benefit from an index. This script finds these columns and displays the selectivity of them. This script can be useful in troubleshooting poorly performing databases by […]

5 (1)

You rated this post out of 5. Change rating

2007-04-09 (first published: )

1,737 reads

Technical Article

Drop a Column and its Constraints and Indexes

  • Script

Drops the specified column from the specified table as well as any constraints and indexes that depend on the column. By default the script will just find the corresponding column, constraints, and indexes.Comes in handy for patching databases.

3.5 (2)

You rated this post out of 5. Change rating

2007-01-24 (first published: )

2,397 reads

Technical Article

Find possible missing foreign key relationships

  • Script

This procedure is intended for single column primary key relationships.First we will create two table functions. The first finds a list of all tables with their primary key columns. The second finds all existing foreign key relationships with their table and column names. Finally we find all tables with primary key column names that do […]

5 (2)

You rated this post out of 5. Change rating

2007-02-26 (first published: )

796 reads

Technical Article

Update statistics for all tables in any DB

  • Script

Most of the time even after executing dbcc dbreindex script on database you won't see much improvement in application/DB performance.  Thats because dbreindex creates statistics for all tables but it executes sp_updatestats which is like sample statistics. To get the maximum performance we had to execute Update statistics with fullscan on table. This simple will […]

4.75 (8)

You rated this post out of 5. Change rating

2006-12-22 (first published: )

15,904 reads

Technical Article

Quick Fix secondary Indexes ( SQL 2000 )

  • Script

In real world production tuning sometimes a "quick fix" is required. This script will generate index create scripts for any column ending ID which doesn't have an index. It's dirty and its quick but you might just be amazed by the results when run against your database!

You rated this post out of 5. Change rating

2007-07-11 (first published: )

480 reads

Blogs

SQL Saturday Boston 2024 Slides

By

Thanks to everyone that came to my talks. Slides are below. Best Practices for...

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers