Thursday, August 20, 2015

Primary Key columns in CRM

I developed the following query today to examine the primary key columns in tables in CRM.  I hope this helps you in some way.




select distinct a.name as KeyColumn, b.name as TableName
from metadataschema.attribute a
inner join metadataschema.entity b
on a.entityid = b.entityid
where a.ispkattribute = 1
order by b.name

No comments:

Post a Comment