何必要存储过程? update a set name=... update b set age=... update c set class=...
create procedure pr_test ( @Name varchar(8), @Age tinyint, @class varchar(8) ) as begin begin tran begin try update A set Name = @Name where ... update B set Age = @Age where ... update C set class = @class where ... commit tran end try begin catch rollback tran end catch
update a set name=...
update b set age=...
update c set class=...
@Name varchar(8),
@Age tinyint,
@class varchar(8)
)
as
begin
begin tran
begin try
update A set Name = @Name where ...
update B set Age = @Age where ...
update C set class = @class where ...
commit tran
end try
begin catch
rollback tran
end catch
end