How can I use an SQL query to find where page types are used in episerver?

  • Page Owner: Not Set
  • Last Reviewed: 2018-11-02

What sort of query could I write to find all locations of a block or page type in an Episerver database?


Additional Posts

I wouldn't write an sql query. I would use the api for this.
ContentModelUsage is the api that you are looking for.

var contentModelUsage = ServiceLocator.Current.GetInstance<IContentModelUsage>();
contentModelUsage.Service.ListContentOfContentType(blockType);

Hope this helps. We use it in limited state as it is a direct database call behind the scenes.