Will SQL update a record if the new values are the same?

sql, sql-server, sql-server-2008, t-sql

Solution

Yes, it will attempt overwrite.

Problem

Will SQL update a record if there is no change to the record? For examople, is it more efficient to replace ``` UPDATE TABLE myTable Set Col1 = ISNULL(Col1,'') ... Set Col100 = ISNULL(Col30,'') ``` with ``` UPDATE TABLE myTable Set Col1 = ISNULL(Col1,'') ... Set Col100 = ISNULL(Col30,'') WHERE Col1 IS NULL OR ... Col30 IS NULL ```

Original source