永发信息网

SQL的存储过程里,其中一条语句出现错误,如何让整个存储过程都不执行

答案:1  悬赏:20  手机版
解决时间 2021-10-16 17:56
  • 提问者网友:鼻尖触碰
  • 2021-10-16 03:03
SQL的存储过程里,其中一条语句出现错误,如何让整个存储过程都不执行
最佳答案
  • 五星知识达人网友:廢物販賣機
  • 2021-10-16 03:49
ALTER PROCEDURE [dbo].[Chejiaxinxi] @frameid int ,@frametype smallint, @dateT smalldatetime, @HJ VArchar(5), @WBZL char(1), @NBZL char(1),@HJGS int, @ZP1 VArchar(5), @ZP2 VArchar(5)=null,@ZP3 VArchar(5)=null,@ZP4 VArchar(5)=null, @zpcount tinyint,@ZPGS int ,@XJ1 VArchar(5),@XJ2 VArchar(5) = null ,@xjcount tinyint,@XJGS int ASbegin SET NOCOUNT ON;BEGIN TRAN INSERT INTO [banhandb].[Production].[ChejiaProductHeader]([FrameID],[FrametypeID],[Date])VALUES(@frameid,@Frametype,@datet)INSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[OutsideQuality],[InsideQuality],[Count],[ManHour])VALUES( @frameid,@hj,1,@wbzl,@nbzl,1,@hjgs )INSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[Count],[ManHour])VALUES( @FrameID,@zp1,2,@zpcount,@zpgs)if @zp2 is not nullbeginINSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[Count],[ManHour])VALUES( @frameid,@zp2,2,@zpcount,@zpgs)endif @zp3 is not nullbeginINSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[Count],[ManHour])VALUES( @frameid,@zp3,2,@zpcount,@zpgs)endif @zp4 is not nullbeginINSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[Count],[ManHour])VALUES( @frameid,@zp4,2,@zpcount,@zpgs)endINSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[Count],[ManHour])VALUES(@frameid,@xj1,3,@xjcount,@xjgs)if @xj2 is not nullbeginINSERT INTO [banhandb].[Production].[ChejiaProductRegister]([FrameID],[PersonNumber],[OperationID],[Count],[ManHour])VALUES(@frameid,@xj2,3,@xjcount,@xjgs) -- Insert statements for procedure hereendIF @@ERROR=0 COMMIT TRANELSE ROLLBACK TRANend
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯