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 […]
2007-04-09 (first published: 2007-02-20)
1,737 reads
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.
2007-01-24 (first published: 2006-12-21)
2,397 reads
Most DBAs are constantly looking for ways to tune their servers to run better. Joe Doherty brings us the second part of his series on indexes with an in depth look at how the indexes are stored in your database.
2007-12-13 (first published: 2006-12-20)
14,340 reads
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 […]
2007-02-26 (first published: 2006-11-17)
796 reads
This script will drop and recreated all indexes in a database within a transaction. The script will also add standard nameing conventions to the index names. Any duplicated indexes are removed.
2007-07-20 (first published: 2006-10-24)
1,358 reads
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 […]
2006-12-22 (first published: 2006-10-23)
15,904 reads
The below command will rebuild all indexes on a database.We need to run the below command in the context of each database that is of interest.
2007-02-21 (first published: 2006-10-23)
1,209 reads
the following scripts helps in finding top 5 missing indexes using the new feature of DMV available in SQl Server 2005
2007-07-19 (first published: 2006-10-23)
5,336 reads
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!
2007-07-11 (first published: 2006-10-10)
480 reads
This script lists all the foreign keys ,the referenced and the referencing tables , along with the column information.
2007-07-09 (first published: 2006-10-04)
311 reads