September 4, 2008 at 2:51 am
Primary key:
SELECT name from sys.tables where objectproperty(object_id,'TableHasPrimaryKey') = 0
Clustered index:
SELECT name from sys.tables where objectproperty(object_id,'TableHasClustIndex') = 0
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 4, 2008 at 3:23 am
'to run this query ,to get result of non using primary key or cluster index tables
SELECT name ,case when objectproperty(object_id,'TableHasPrimaryKey') =0 then 'No' else 'Yes' end IsPrimaryKey,
case when objectproperty(object_id,'TableHasClustIndex') =0 then 'No' else 'Yes' end IsClustIndex
from sys.tables where objectproperty(object_id,'TableHasPrimaryKey') =0 or objectproperty(object_id,'TableHasClustIndex') = 0
September 4, 2008 at 4:17 am
Hello,
Thank you both for replying, I got what was needed from them.
Cheers,
P.
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply