2010-02-27

Get the params of all localized attributes and all picklist values

SELECT
 e.Name as EntityName
 ,l.Label as 'Наименование атрибута', a.LogicalName ,at.Description as 'Тип атрибута' ,a.AttributeLogicalTypeId
 ,apv.Value as 'Значения пиклиста', lp.Label as 'Наименования пиклиста'
 ,[AttributeRequiredLevelId]
 ,[MaxLength]
 ,[MinValue]
 ,[MaxValue]
 ,LookupClass
 ,LookupStyle
 ,LookupBrowse
FROM
 [NaviconGroup_MSCRM].[MetadataSchema].[Attribute] a
 join MetadataSchema.Entity e on e.EntityId=a.EntityId
 join MetadataSchema.AttributeTypes at on at.AttributeTypeId=a.AttributeTypeId
 join MetadataSchema.LocalizedLabel l on l.ObjectId=a.AttributeId and l.ObjectColumnName='DisplayName'
 left join MetadataSchema.AttributePicklistValue apv on apv.AttributeId=a.AttributeId
 left join MetadataSchema.LocalizedLabel lp on lp.ObjectId=apv.AttributePicklistValueId
order by EntityName, l.Label, at.Description,apv.Value

Комментариев нет: