create procedure test_tran inputdata as smalldatatime
as
if inputdata = month(getdate())
begin
begin tran
insert into XX select * from yy whre date = inputdate
insert into ZZ select * from AA where date = inputdate
if error <> 0
goto err_this
commt tran
end
err_this;
begin
print "err tran"
roll tran
end
------------------------------------------------------------