Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
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.