Behind the scene
There was a story when I created this script. There was an issue on our production server. After investigated, there was no index on one table but the table has an index on testing environment. Looks like when published the table, the DBA missed publish the index. After this issue, my supervisor asked me to create a script for listing all tables that do not have an index. Every table should be have an index obviously. Below script could not run on SQL Server 2000 and previous version.
Below the script for list index availability of the tables.
Result of the script
|TableName||Name of the table|
|SchemaName||Name of the schema|
|HasIndex||Yes if the table has an index vice versa|
|IndexName||Name of the index|
|IndexKeys||Keys of the index|
|IsPrimaryKey||Is this index a primary key?|
|IndexType||Type of the…|
Ver la entrada original 455 palabras más