January 30, 2008 at 2:16 am
Comments posted to this topic are about the item Generate index on foreign key columns
March 4, 2008 at 2:09 am
Does this work where the foreign key constraint consists of more than one column?
John
March 4, 2008 at 9:09 am
Which version of SQL Server is this written for? I've got 2000, and neither the table names nor column names match the system tables.
March 4, 2008 at 12:32 pm
There are times when an index is not needed for a foreign key. If the table is small (low number of rows) or the index column has little selectivity, then why add the overhead of an index? I wrote a similar script about a month ago, but found that the were many times the index just wasn't needed.
Mike Byrd
March 4, 2008 at 12:48 pm
Mike Byrd (3/4/2008)
There are times when an index is not needed for a foreign key. If the table is small (low number of rows) or the index column has little selectivity, then why add the overhead of an index? I wrote a similar script about a month ago, but found that the were many times the index just wasn't needed.
It can be run as just a select first to pull up a list for evaluation. A starting point like that can be useful when you're trying to tune an inherited database.
February 5, 2009 at 2:01 am
How can we modify this script to :
- Rename all PK indexes to "IX_[TableName];
- Rename all FK indexes to "IX_[TableName]_[ColumnName]";
Thanks
May 11, 2016 at 7:02 am
Thanks for the script.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply