ALTER PROCEDURE [dbo].[Proc_GetBillNumber]
@Bill_Head varchar(50)
AS
DECLARE @MyErr NVARCHAR(500)
Begin Transaction
insert into ...
update ....
COMMIT TRANSACTION
IF @@ERROR <> 0 --运行错误
BEGIN
ROLLBACK TRANSACTION
SET @MyErr = CAST(@@Error AS Nvarchar(500))
RAISERROR(@Myerr,16,1)
RETURN
END
END
ELSE
BEGIN
ROLLBACK TRANSACTION
RETURN -1;
END
目的呢?