这是我的存储过程,我认为每件事都是正确的
ALTER PROC USP_D_Delete
(
@ID INT=NULL,
@RETURN INT OUTPUT
)
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
BEGIN TRAN
BEGIN
DELETE FROM PE WHERE ID =@ID
END
COMMIT
SET @RETURN = 1
RETURN @RETURN
END TRY
BEGIN CATCH
ROLLBACK
SET @RETURN = 0
RETURN @RETURN
END CATCH
END
当我尝试从 UI 执行此操作时,我得到 ERROR 作为
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements.Previous count = 0, current count = 1
请提供任何帮助,我找不到解决方案,因为我认为这种语法是正确的,在 ROLLBACK 之后尝试了 COMMIT 也,它没有用..