2010-02-27

Get the localized names of all entities

select  ObjectTypeCode, Name, LogicalName, l.Label
from MetadataSchema.Entity e left join
MetadataSchema.LocalizedLabel l on e.EntityId=l.ObjectId
where l.ObjectColumnName='LocalizedName'
 and l.CustomizationLevel=1

union

select  ObjectTypeCode, Name, LogicalName, l.Label
from MetadataSchema.Entity e left join
MetadataSchema.LocalizedLabel l on e.EntityId=l.ObjectId
where l.ObjectColumnName='LocalizedName'
 and l.CustomizationLevel=0 
 and ObjectTypeCode not in 
  ( select  ObjectTypeCode
   from MetadataSchema.Entity e left join
   MetadataSchema.LocalizedLabel l on e.EntityId=l.ObjectId
   where l.ObjectColumnName='LocalizedName'
    and l.CustomizationLevel=1
  )

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