USE [LABORATORY] GO /****** Object: StoredProcedure [dbo].[Lab_BF_SaveInterpretation] Script Date: 06/23/2018 09:19:31 ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER OFF GO ALTER PROCEDURE [dbo].[Lab_BF_SaveInterpretation] @Code int, @ExamId varchar(4), @Interpretation text, @Status bit, @isMethod varchar(4)='0', @isNormalValue varchar(4)='0', @isComment varchar(4)='0', @isInterpretation varchar(4)='0' AS If exists (Select ExamId from tbLab_BuildInterpretations where Code = @Code) Begin Update tbLab_BuildInterpretations Set Interpretation = @Interpretation, [Status] = @Status, isMethod= @isMethod , isNormalValue=@isNormalValue, isComment=@isComment , isInterpretation=@isInterpretation Where Code = @Code End Else Begin Insert Into tbLab_BuildInterpretations (Interpretation, ExamId, [Status],isMethod,isNormalValue,isComment,isInterpretation) Values (@Interpretation, @ExamId, @Status,@isMethod,@isNormalValue,@isComment,@isInterpretation) End