select convert(varchar(50), obj.name) [table], ndx.rows, coalesce(( select status & 15 from sysconstraints where status & 15 = 1 and id = obj.id ), 0) primarykey from sysindexes ndx, sysobjects obj where indid < 2 and ndx.id = obj.id and obj.type = 'U' and obj.name != 'dtproperties' order by obj.name