Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kumarich1
Yak Posting Veteran
99 Posts |
Posted - 2007-11-27 : 14:42:34
|
I am looking for a script to find list of indexes on a table.Thanks |
|
jhocutt
Constraint Violating Yak Guru
385 Posts |
Posted - 2007-11-27 : 14:52:07
|
select o.name as 'Table', i.name as 'Index', case indidwhen 0 then 'Primary Key'when 1 then 'Clustered'else 'Non-clustered' end as 'IndexType'from sysindexes ijoin sysobjects o on o.id = i.idwhere o.xtype = 'U' --User Tables 'V' is Views 'S' is System Tablesorder by 1,indid,2"God does not play dice" -- Albert Einstein"Not only does God play dice, but he sometimes throws them where they cannot be seen." -- Stephen Hawking |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-11-28 : 02:46:23
|
Or sp_indexes. |
 |
|
|
|
|