Amit Sharma
Amit Sharma

Reputation: 1088

Where does sitecore store item statistics data in database..?

i just want to know where sitecore stores Items statistics data. Using SQL query i want to get recently updated items. i write a query for Sitecore_Master database on Items table, there i found created,updated fields as well, while these columns contains different values with sitecore item statistic values my sql query is:

 select name,created,updated from items where id='{EFDC1A0B-C40D-42B9-880B-0A09D4686E60}'

it is working for me, while i need statistics data.

Anyone have idea which table sitecore used to store statistics data for sitecore item.

Thanks

Upvotes: 5

Views: 1101

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27132

Sitecore stores Created and Updated values for every specific version of the item. That's why it's stored in the VersionedFields table.

You can use this query to get items updated after 2015-10-27:

SELECT
    vf.Value AS Updated,
    item.ID AS ItemId,
    item.Name AS ItemName
FROM
    VersionedFields vf 
    JOIN Items item ON item.ID = vf.ItemId
WHERE
    vf.FieldId = 'D9CF14B1-FA16-4BA6-9288-E8A174D4D522' -- id of the __updated field
    -- vf.FieldId = '25BED78C-4957-4165-998A-CA1B52F67497' -- id of the __created field
    AND vf.Value > '20151027'

Please keep in mind that Sitecore stores dates in UTC in the table.

Upvotes: 5

Related Questions