|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, December 09, 2010 2:28 PM
Points: 42,
Visits: 79
|
|
I need to find keycnt equivalent in sysindexes table, in the new objects in SQL 2008 like sys.indexes, sys.foreign_keys.
Thanks
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 8:23 AM
Points: 37,644,
Visits: 29,897
|
|
Perhaps something like this will work?
SELECT object_name(i.object_id) as TableName, name as IndexName, KeyCount FROM sys.indexes i inner join (select COUNT(*) as KeyCount, object_id, index_id from sys.index_columns where is_included_column = 0 group by object_id, index_id) ic on i.object_id=ic.object_id and i.index_id = ic.index_id
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|