Tuesday, September 1, 2009

limitation of creating the custom attributes in MS CRM 4.0

There is no limitation of creating the custom attributes in CRM. You can create n no of attributes within an entity. Bt as you know we have tables corresponding to each n every entity in the CRM DB and there is a limitation in database level. SQL Server allows up to 1024 columns per table and the amount of data stored in any row cannot exceed 8060 bytes. If so, while creating or updating CRM page will through SQL server error or sometimes it won’t allow you to perform any operation on this entity/records.

You can determine the number of bytes available for entities by running the following query in _METABASE database.

select e.Name, Bytes_Remaining = 8060 - (sum(a.length))from entity e
join attribute a on e.entityid = a.entityidwhere a.iscustomfield = 1
and a.islogical = 0group by e.Name

You can determine the number of bytes used for entities by running the following query in _METABASE database.

select e.Name, Physical_Size = sum(a.length)from entity e
join attribute a on e.entityid = a.entityidwhere a.iscustomfield = 1
and a.islogical = 0group by e.Name

No comments: