SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to detect changes with each on each item update, )but i don't want to use the before, after properties )

My question is:

If i enable list versioning can i diff 2 versions to detect changes, what would be the performance impact? (storage, versions retrieval)


share|improve this question
up vote 1 down vote accepted

It depends on which technique you plan to use:

  • Event Handlers - use ItemUpdating having properties object contains the collections BeforeProperties and AfterProperties that helps you to find out what has changed for your item, i.e. compare properties.BeforeProperties[].ToString() with properties.AfterProperties[].ToString(). You can also modify the value of the fields in AfterProperties to affect what is actually stored in the list.

  • SPD Workflows - use the Activity "Wait for field change" and the you could compare the 2

If you need to handle it across versions use something similar to

 if ((item.Versions!= null) && (item.Versions.Count > 0))
                     SPListItemVersionCollection versions = item.Versions;
//work with through the colection

share|improve this answer
What is the performance hit on versions? – Zapacila Aug 10 '12 at 13:51
Haven't really benchmark it, but you actually retrieving ListItems – Marius Constantinescu - MVP Aug 10 '12 at 14:56
Thanks! i hope the DB won't get huge – Zapacila Aug 10 '12 at 16:37
Actually that is already optimized upon extraction of versions per item, but is worth running some benchmarking if you really do a lot of operations on versions – Marius Constantinescu - MVP Aug 10 '12 at 17:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.