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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'System tables' v. 'Information Schema views'

Status
Not open for further replies.

NaoTriste

Programmer
Dec 17, 2002
29
GB
I was replacing some Stored Procedure code which acesses the System tables to get the same data from the Information Schema tables instead so as to avoid having to change them if the system tables change from version to version.

However I wasn't able to find a way of getting the index names (taken originally from sysindexes) from any of the Information Schema views.

It seems that the views provide information for 'constraints' : Primary Keys & Referential Constraints but not ordinary indexes.

Can anybody confirm that this is the case and therefore I will still have to use the 'sysindexes' for this ???
 
The only other thing I'm aware of (other than the sysindexes table)is the system stored procedure sp_helpindex but you will need to supply the table name each time you call it. I don't know if this is a viable option for what you need.

 
Either that, or sp_statistics <table_name> for more detailed machine-readable output.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top