In SQL, is UPDATE always faster than DELETE+INSERT?

前端 未结 15 2177
梦谈多话
梦谈多话 2020-11-29 20:01

Say I have a simple table that has the following fields:

  1. ID: int, autoincremental (identity), primary key
  2. Name: varchar(50), unique, has unique index<
15条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 20:55

    Just tried updating 43 fields on a table with 44 fields, the remaining field was the primary clustered key.

    The update took 8 seconds.

    A Delete + Insert is faster than the minimum time interval that the "Client Statistics" reports via SQL Management Studio.

    Peter

    MS SQL 2008

提交回复
热议问题