I would suggest to create a stored procedure and inside the stored procedure
you can easily you the transaction block, something like below
Create Procedure ProcName(@level int, @updlevel int)
As
BEGIN
BEGIN TRAN
UPDATE trycsv SET level = @level where level =@updlevel
If @@Error=0
Commit Tran
Else
Rollback Tran
END