Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.
CREATE PROC [dbo].[InsertEmployee] @EmployeeNo int, @ClassValue Decimal(18,2) AS IF NOT EXISTS (select employeeno from Phone where employeeno = @EmployeeNo and PhoneNumber = @PhoneNumber) BEGIN DECLARE @CONTEXT_INFO varchar(100) SELECT @CONTEXT_INFO = COALESCE(CONVERT(VARCHAR(128), CONTEXT_INFO()), CURRENT_USER) Declare @Level deceimal(18,2) SELECT @Level = Ad.ClassValue FROM Employee Ad WHERE Ad.Employeeno= @EmployeeNo If(@Level !=Ad.ClassValue) BEGIN update [Employee] set ClassValue= '01', UpdatedBy = @CONTEXT_INFO where employeeno = @EmployeeNo END Else Begin update [Employee] set ClassValue= ClassValue, UpdatedBy = @CONTEXT_INFO where employeeno = @EmployeeNo End Else Begin I will insert. END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.