I am running the following SQL Update Query in a transaction so that I can examine the results before committing. However, after executing and rolling back, I find that it has already committed and my data has changed despite never issuing a commit statement.
USE WS_Live
BEGIN TRAN Test
UPDATE AF
SET AF.AdditionalFieldsLookup11 = NULL
OUTPUT inserted.*
FROM dbo.Incident AS I
INNER JOIN dbo.AdditionalFields AS AF
ON AF.Oid = I.AdditionalFields
INNER JOIN dbo.AdditionalFieldsLookup11 AS AFL11
ON AFL11.Oid = AF.AdditionalFieldsLookup11
WHERE AF.AdditionalFieldsLookup11 IS NOT NULL
My statement was formatted properly and I did not lose any important data, but I would like to know why this is happening so that I don't run into problems in the future.