2 edited body
source | link

SQL server may choose to perform an in-place update or an insert and a delete depending on many factors and you shouldn’t worry about it. Since the keys are not being updated I would leave them out ifof the SET clause to help the optimizer make the best decision.

If you are using SQL Server 2008 or later, look at the MERGE statement which can replace both operations: https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-2017

HTH

SQL server may choose to perform an in-place update or an insert and a delete depending on many factors and you shouldn’t worry about it. Since the keys are not being updated I would leave them out if the SET clause to help the optimizer make the best decision.

If you are using SQL Server 2008 or later, look at the MERGE statement which can replace both operations: https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-2017

HTH

SQL server may choose to perform an in-place update or an insert and a delete depending on many factors and you shouldn’t worry about it. Since the keys are not being updated I would leave them out of the SET clause to help the optimizer make the best decision.

If you are using SQL Server 2008 or later, look at the MERGE statement which can replace both operations: https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-2017

HTH

1
source | link

SQL server may choose to perform an in-place update or an insert and a delete depending on many factors and you shouldn’t worry about it. Since the keys are not being updated I would leave them out if the SET clause to help the optimizer make the best decision.

If you are using SQL Server 2008 or later, look at the MERGE statement which can replace both operations: https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-2017

HTH