SQL Server 2005带事务的存储过程示例[自用标记]
set ANSI_NULLS ONset QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author:<Author,,Name>
-- Create date: <Create Date,,>
-- Description:<Description,,>
-- =============================================
ALTER PROCEDURE .
@orgID varchar(32)
AS
BEGIN
begin tran TranStart
save tran FirstPoint
update .
set =1
where =@orgID
update .
set =1
where ID in (
select a.ID from dbo.ssidb_Organization a
, dbo.ssidb_f_cid(@orgID) b
where a.ID = b.ID
)
if @@ERROR <> 0
begin
rollback tran FirstPoint
end
commit tran TranStart
END
页:
[1]