Surendra Sharma

Surendra Sharma

Search This Blog

Saturday, October 8, 2016

Sitecore database lesson 2 - Access items and field values from Database




You can access Sitecore items directly from database.


Lets take an example of Home items in Sitecore as

Home Item in Sitecore
Home Item in Sitecore

Home item id is “{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}”.

Items are stored in ArchivedItems and Items tables in Master database.

Fields data is stored in ArchivedFields, SharedFields, UnversionedFields and VersionedFields tables as

Table for Items and fields
Table for Items and fields

You can use below query to get fields values 

SELECT vf.ItemId, [Items].Name ItemName, vf.ID, vf.Language, vf.FieldId, vf.Value from [dbo].[versionedFields] vf INNER JOIN [dbo].[Items] ON [Items].ID = vf.ItemId WHERE [Items].Id='110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9' and Language='en'

This query gives you output of HOME item fields data as


Field Details
Field Details


I hope you like this Sitecore database lesson. Stay tune for more Sitecore database related articles. 

Please leave your comments or share this article if it’s useful for you.