存储过程(Procedure)常用示例代码
ALTER PROCEDURE SP_TEST
AS
BEGIN TRANSACTION
declare @strcount int,@errid int
select @strcount=count(*) from isoapprove where isoid=3 and roleid=6 and userid=325
if(@strcount>0)
begin
set @errid=99
GOTO Error_Handle
select getdate()
end
COMMIT TRANSACTION
RETURN(0)
Error_Handle:
ROLLBACK TRANSACTION
RETURN(@errid)
浙公网安备 33010602011771号