Why does an UPDATE take much longer than a SELECT?

后端 未结 4 944
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-19 04:27

I have the following select statement that finishes almost instantly.

declare @weekending varchar(6)  
set @weekending = 100103

select InvoicesCharges.order         


        
4条回答
  •  借酒劲吻你
    2020-12-19 05:27

    The update has to lock and modify the data in the table, and also log the changes to the transaction log. The select does not have to do any of those things.

提交回复
热议问题