Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving Index references using Information_Schema 1

Status
Not open for further replies.

gradley

Programmer
Feb 24, 2004
335
US
Does anyone know how to retrieve the index information (clustered and non-clustered) for a table using INFORMATION_SCHEMA? I know that Microsoft wants you to stay away from system tables such as sysindexes but I cannot determine how to retrieve this information through the schemas.

 
There are a lot of things that aren't available via those views. I think this is one of those that you have to use sysindexes for.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Depending on how much information you need you can use sp_helpindex to retrieve basic information on the indexes for the table. You may have tried this though and not gotten the information that you need.

jitter
 
Actually this is one procedure I hadn't looked at. It's not perfect but it allows me to extract the seqeuce of the fields in each of the indexes.

Thank you!
 
Thought you wanted to do it using the information_schema views?
If you are going to use sp_helpindex you may as well use the system tables directly.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top