Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Index Key Count Expand / Collapse
Author
Message
Posted Wednesday, September 10, 2008 12:55 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, December 9, 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
Post #567230
Posted Wednesday, September 10, 2008 1:33 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 10:03 AM
Points: 40,385, Visits: 36,829
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

Post #567266
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse