Find if tables has Clustered Index in a database
By [)ia6l0 iii
Find if a table has a Clustered Index using the Information_Shcema tables.
Refer sample query below:
Select IST.TABLE_NAME,
Case objectProperty(object_id(IST.TABLE_NAME), 'TableHasClustIndex')
When 0 then 'Noy present'
When 1 then 'Present'
End as [Has Clustered Index]
From INFORMATION_SCHEMA.TABLES IST
Where objectProperty(object_id(IST.TABLE_NAME), 'IsUserTable') = 1
Order by [Has Clustered Index] , IST.TABLE_NAME asc
Find if tables has Clustered Index in a database (974 Views)