Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.
ALTER PROC [dbo].[InsertPhone] ( @EmployeeNo int , @PhoneNumber char(24) ) as begin declare @CONTEXT_INFO varchar(100) select @CONTEXT_INFO = COALESCE(CONVERT(VARCHAR(128), CONTEXT_INFO()), CURRENT_USER) UPDATE o SET o.employeeno = c.employeeno , o.PhoneNumber =c.PhoneNumber ,o.DateUpdated=getdate() , o.CreatedBy=@CONTEXT_INFO , O.UpdatedBy=@CONTEXT_INFOT FROM Phone o JOIN ADUser c ON c.EmployeeNo = o.EmployeeNo WHERE c.EmployeeNo = @EmployeeNo IF @@ROWCOUNT = 0 BEGIN INSERT INTO [Phone] ( employeeno , PhoneNumber , CreatedBy , UpdatedBy ) SELECT Ad.employeeno , Ad.PhoneNo , @CONTEXT_INFO , @CONTEXT_INFO FROM ADUser AD WHERE Ad.employeeno=@EmployeeNo END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|SQL select to return records that don't exist (crosjoin?)||3||38|
|TSQL remove duplicates from different columns||14||50|
|What does "Between" mean?||6||36|
|SQL: Transformation or Pivot||3||29|
Join the community of 500,000 technology professionals and ask your questions.