Following code in SQLServer:
BEGIN TRY
BEGIN TRANSACTION TRAN
UPDATE Authors
SET Phone = '415 354-9866'
WHERE au_id = '724-80-9391';
COMMIT TRAN
END TRY
BEGIN CATCH
ROLLBACK TRAN
END CATCH
In authors table there is a trigger. Means before update trigger inserts a new records into a temp table. Query:
- If exception occurs when it update in authors table. Because trigger insert new record at the same time. Whether new record will rollback as select update statement is inside transaction?
- If exception occurs in side triggers when insert a new record then what will happen means it will update or rollback authors table?