What happens when a update statement runs in sql server? steps inside sql engine in detail ?

  • Hi Champs,

    What happens when a update statement runs in sql server? steps inside sql engine in detail ?

    Regards,
    Ravi:)

  • ravi@sql - Sunday, October 29, 2017 11:16 PM

    Hi Champs,

    What happens when a update statement runs in sql server? steps inside sql engine in detail ?

    Regards,
    Ravi:)

    It really depends. Often it's a delete followed by an insert but that's not always the case. If the index key isn't changed, it can do the update in place but that doesn't mean it will always do an in place update. There can be different results with an update such as having a row being larger which can result in forwarded rows. If the key is changed, it doesn't do an in place update which is often reported to be the case. A couple of good posts on this would be:
    Are all updates split into delete-insert?
    Do changes to index keys really do in-place updates?

    Both provide some great examples and enough information for you to play around with different scenarios.

    Sue

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply