SQL: What on earth is Halloween protection?
If you’ve worked with SQL Server (or with databases in general) for any length of time, you will have heard someone refer to “Halloween protection”. It refers to a problem where update operations could inadvertently end up modifying a row more than once.
I saw someone who was pretty knowledgeable complaining about just this problem recently. He was using a dynamic cursor in SQL Server. The problem was that he was progressing along an index, but when a row was modified, it was relocated to a position in front of where he was processing, so it got processed again.
2019-02-01