--修改
alter proc update_demo
@id int,
@name varchar(50),
@falg bit output
as
begin
set nocount on
begin tran
update aa set name=@name where id=@id
if @@error<>0
begin
set @falg=1
rollback
end
else
begin
set @falg=0
commit
end
set nocount off
end