Is the following statement an atomic operation?
UPDATE [table1]
SET column1=@val1, column2.WRITE(@val2, NULL, 0) WHERE table1_id=@id
or should it be placed inside a transaction to ensure that none or both columns are updated in case of error situations?
Columns are defined as:
column1 int not null,
column2 varbinary(max) not null
It is one statement. In SQL Server, each statement carries an implied transaction. Here is another answer if you'd like more details.
What does a transaction around a single statement do?
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