In SQL Server 2008, how do I update fields in a table only if their values differ with the values in the update statement ?
For example:
I have TableA with column FirstName whose value is 'Roger Moore' with an unique id of '007'. Now, i am calling an update statement but it should update the 'FirstName' field only if value is something else other than 'Roger Moore'.
TIA
update TableA
set FirstName = 'Roger Moore'
where ID = '007'
and FirstName <> 'Roger Moore'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With