Sql-server – Performance on updating row

performancequery-performancesql servert-sqlupdate

When updating in SQL Sever, it is my understanding that the entire row is deleted and then recreated (which is why you get a new timestamp). So then, if you update 1 field or 500 fields, does the performance of the update change?

I suspect that if there are indexed columns, as it has to update the index, there would be more "work" for the server to perform. When answering, assume that there are no triggers.

Best Answer

If you are trying to decide whether to build a dynamic or CASE expression, omitting columns whose values haven't changed, I'd say that it depends on your index structure, and you will need to test. In this article, I found that with a single, simple, clustered primary key, the blind update was always faster; this changed in some scenarios when multiple indexes were added.

http://www.sqlperformance.com/2012/10/t-sql-queries/conditional-updates

Where the breaking point is, I'm not sure; nor did I test with dynamic SQL.