dbo.fSQLStatistics
This function returns as a result set a list of statistics about a table and the indexes associated with the table.
Syntax
dbo.fSQLStatistics (<'database_qualifier' | null>, <'table_name' | null>, <'unique' | null>)
Arguments
Returned Result Set
Example
This example returns statistics about all indexes for all tables that begin with the letter "c" in the default DEMODATA sample database. NULLs are excluded from INDEX_NAME. See also String Search Patterns.
SELECT * FROM dbo.fSQLStatistics ('Demodata', 'c%', 1) WHERE INDEX_NAME IS NOT NULL
 
Result Set (abbreviated for space considerations):
TABLE_NAME   INDEX_NAME          COLUMN_NAME
==========   ================    ====================
Class        UK_ID               ID
Class        Class_Name          Name
Class        Class_Name          Section
Class        Class_seg_Faculty   Faculty_ID
Class        Class_seg_Faculty   Start_Date
Class        Class_seg_Faculty   Start_Time
Class        Building_Room       Building_Name
Class        Building_Room       Room_Number
Class        Building_Room       Start_Date
Class        Building_Room       Start_Time
Course       Course_Name         Name
Course       DeptName            Dept_Name
 
12 rows were affected.