日期:2014-05-17 浏览次数:20670 次
IF @label2+ @label3 +@label4 +@label5 +@label6 IS NULL BEGIN RETURN END BEGIN TRY update student set parent_id=@case_id where type='box' and label =@label1; update student set parent_id=@case_id where type='box' and label =@label2; update student set parent_id=@case_id where type='box' and label =@label3; update student set parent_id=@case_id where type='box' and label =@label4; update student set parent_id=@case_id where type='box' and label =@label5; update student set parent_id=@case_id where type='box' and label =@label6 END TRY begin CATCH SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity ,ERROR_STATE() AS ErrorState ,ERROR_PROCEDURE() AS ErrorProcedure ,ERROR_LINE() AS ErrorLine ,ERROR_MESSAGE() AS ErrorMessage; END CATCH
------解决方案--------------------
补充下1#的
if @label1+@label2+ @label3 +@label4 +@label5 +@label6 is null or len(@label1)=1 or len(@label2)=1 or len(@label3)=1 or len(@label4)=1 or len(@label5)=1 or len(@label6)=1 return else begin try update student set parent_id=@case_id where type='box' and label =@label1; update student set parent_id=@case_id where type='box' and label =@label2; update student set parent_id=@case_id where type='box' and label =@label3; update student set parent_id=@case_id where type='box' and label =@label4; update student set parent_id=@case_id where type='box' and label =@label5; update student set parent_id=@case_id where type='box' and label =@label6 end try begin catch select ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity ,ERROR_STATE() AS ErrorState ,ERROR_PROCEDURE() AS ErrorProcedure ,ERROR_LINE() AS ErrorLine ,ERROR_MESSAGE() AS ErrorMessage; END CATCH
------解决方案--------------------