I want two update and one delete statements that should be executed together as one single transaction. Is the following syntax correct? Can the if statement be used within the transaction

begin tran
update table1 set f1 = "asfs"
if @@error <>0
goto rlbk

update table2 set f2 = "gfdg"
if @@error <>0
goto rlbk

delete from table1 where f3 = "asdf"
if @@error <>0
goto rlbk

commit tran
return
rlbk:
rollback tran